Skip to content

Fix #3463 CAN read() return value #3492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2017

Conversation

Nodraak
Copy link
Contributor

@Nodraak Nodraak commented Dec 21, 2016

Description

This PR includes two commits which fix two things both related to the CAN read() method, but if you prefer two separate PRs, I can do it without any problem.

1 - CAN read() return value

The first commit fixes bug #3463 (CAN read() return value).

Disclaimer: Although this PR as only been tested on nucleo F303K8 and L476RG, I expect others series to work too.

  • STM32F0: checked registers with the reference manual of the F0 serie
  • STM32F1: checked registers with the reference manual of the F1 serie
  • STM32F2: has a cortex m3, this is assumed to be working as a F3
  • STM32F3: successfully tested with a nucleo F303K8
  • STM32F4: checked registers with the reference manual of the F4 serie
  • STM32F7: wild guessed
  • STM32L4: successfully tested with a nucleo L476RG

2 - bit set vs. register reset

The second commit prevent the reset of the whole RF0R register. I am not sure what is the impact, since at first my PR seemed to be working without, but I think that at least it does no harm.

@Nodraak Nodraak changed the title Fix/3463/can read return value Fix #3463 CAN read() return value Dec 21, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Dec 22, 2016

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 22, 2016

@Nodraak Can you please sign https://developer.mbed.org/contributor_agreement/ and share a nickname on mbed?

Copy link
Contributor

@LMESTM LMESTM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change definitely looks good to me

@LMESTM
Copy link
Contributor

LMESTM commented Dec 22, 2016

@Nodraak the change sounds more than reasonable - thanks for posting it !

@Nodraak
Copy link
Contributor Author

Nodraak commented Dec 22, 2016

@0xc0170 so I guess I've accepted the contributor agreement https://developer.mbed.org/users/Nodraak/

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 23, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1323

All builds and test passed!

// check FPM0 which holds the pending message count in FIFO 0
// if no message is pending, return 0
if ((can->RF0R & CAN_RF0R_FMP0) == 0)
return 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small code style change, it should be surrounded by { and }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I squash my commit or make a new one ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preferably squashed (edit the commit that changes this lines).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't have my computer until the 2nd of January, ping me the 3rd if I forget

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 30, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1338

All builds and test passed!

@Nodraak Nodraak force-pushed the fix/3463/can_read_return_value branch from 99ed8d1 to 885b018 Compare January 3, 2017 10:46
@Nodraak
Copy link
Contributor Author

Nodraak commented Jan 3, 2017

Just squashed the code style change + rebased master (~70 new commits since)

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2017

/morph test

Just squashed the code style change + rebased master (~70 new commits since)

Thanks

@mbed-bot
Copy link

mbed-bot commented Jan 3, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1345

All builds and test passed!

@sg- sg- merged commit cefae22 into ARMmbed:master Jan 9, 2017
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions ARMmbed/mbed-os#3488
3492: Fix #3463 CAN read() return value ARMmbed/mbed-os#3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly ARMmbed/mbed-os#3503
3504: [LPC15xx] CAN implementation improvements ARMmbed/mbed-os#3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral ARMmbed/mbed-os#3539
3540: STM: SPI: Initialize Rx in spi_master_write ARMmbed/mbed-os#3540
3438: K64F: Add support for SERIAL ASYNCH API ARMmbed/mbed-os#3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set ARMmbed/mbed-os#3519
3544: STM32L4 deepsleep improvement ARMmbed/mbed-os#3544
3546: NUCLEO-F412ZG - Add CAN peripheral ARMmbed/mbed-os#3546
3551: Fix I2C driver for RZ/A1H ARMmbed/mbed-os#3551
3558: K64F UART Asynch API: Fix synchronization issue ARMmbed/mbed-os#3558
3563: LPC4088 - Fix vector checksum ARMmbed/mbed-os#3563
3567: Dev stm32 F0 v1.7.0 ARMmbed/mbed-os#3567
3577: Fixes linking errors when building with debug profile ARMmbed/mbed-os#3577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants