Skip to content

STM32 - CAN - Fix RTR position bit in TX mailbox register #5610

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 1 commit into from Dec 12, 2017
Merged

STM32 - CAN - Fix RTR position bit in TX mailbox register #5610

merged 1 commit into from Dec 12, 2017

Conversation

ghost
Copy link

@ghost ghost commented Nov 28, 2017

  • Bug fix
  • Target STM32, Peripheral CAN

Description

The RTR bit that defines the type of CAN message (Data or Remote) was written as bit0 in CAN_TIxR (the CAN TX mailbox).
According to Reference Manual p. 1606 of STM32L476RG, also verified for STM32F103, STM32F302 (seems to be the same for all STM32 offering CAN:

Bit 0 TXRQ: Transmit mailbox request
Set by software to request the transmission for the corresponding mailbox.
Cleared by hardware when the mailbox becomes emp

Bit 1 RTR: Remote transmission request
0: Data frame
1: Remote frame

The RTR bit has been shifted by 1 to the left in order to put it in the right place.

Consequences

Bad behavior observed : Only Data message were sent, even if CAN::write(CANMessage msg) was called with a Remote-type message as argument.

After fix : Remote messages are correctly sent.

Copy link
Contributor

@bcostm bcostm left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. LGTM.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 1, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 1, 2017

Build : SUCCESS

Build number : 636
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5610/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 1, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 1, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 5, 2017

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Dec 5, 2017

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.

3 participants