CAN BSL Initialization frame payload

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User5581
Level 3
Level 3
In the XMC4500 reference manual v1.3 the CAN BSL initialization frame is shown in Figure 26-13.
In that diagram, the first two payload bytes of the frame are described as BTR-L and BTR-H.

The body text in that section of the reference manual does not describe BTR-L and BTR-H.
I am guessing they are related to the NBTR register of the CAN peripheral at node 0, but it is not clear.

Questions:
1) What is the interpretation of the BTR-L and BTR-H payload bytes in the CAN BSL Initialization frame?

2) What value should be sent from the host in these payload bytes in the CAN BSL Initialization frame with 11 bit CAN-ID set to 0x555?

Regards,
-Kurt
0 Likes
7 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
zoompig wrote:
In the XMC4500 reference manual v1.3 the CAN BSL initialization frame is shown in Figure 26-13.
In that diagram, the first two payload bytes of the frame are described as BTR-L and BTR-H.

The body text in that section of the reference manual does not describe BTR-L and BTR-H.
I am guessing they are related to the NBTR register of the CAN peripheral at node 0, but it is not clear.

Questions:
1) What is the interpretation of the BTR-L and BTR-H payload bytes in the CAN BSL Initialization frame?

2) What value should be sent from the host in these payload bytes in the CAN BSL Initialization frame with 11 bit CAN-ID set to 0x555?

Regards,
-Kurt



Hi Kurt,

1. BTR-L and BTR-H refers to the NBTR register
2. See picture below.

648.attach


647.attach
0 Likes
User5581
Level 3
Level 3
Hi Travis,
Thank you for your kind response.

To clarify the action of the BTR fields as payload bytes 0 and 1 in the CAN frame: (Please correct me if I am wrong in this description)

Presumably, the CAN-BSL Startup Software (SSW) can not know the CAN bit rate used by the host just after reset. So it must contain an automatic bit rate discovery algorithm that runs while trying to receive the CAN BSL initialization frame. The host is to retransmit this frame until this algorithm adjusts the NBTR register in the CAN peripheral until the XMC does successfully receive the one of these frames.

So, what numeric value should be sent by the host in the BTR fields of the 0x555 CAN BSL initialization frame? Should the desired contents of the NBTR register in the CAN peripheral should be placed there? It would seem that the SSW would have arrived at this information by itself in the NBTR already during atomatic bit rate detection.

Perhaps the NBTR settings automatically arrived at by the SSW are non-optimal, and it is looking for more optimal setting to use for further CAN communication.

Are the contents of the BTR bytes in the initialization frame written to the NBTR register upon the first successful receive of the initialization frame by the SSW?


Also, in the reference manual v1.3 under 26.1.10 CAN BSL Mode - Acknowledgement phase it is stated:
After the dominant bit has been transmitted, an acknowledgement frame using the ACKID extracted from the initialization frame is sent to the host.

The example above shows 0x55 - 0x05 in the ACKID fields of the Acknowledgement frame in response to 0x00 - 0x00 in the ACKID fields of the initialization frame.
How is the ACKID reply in the acknowledgement frame extracted from the ACKID contents in the Initialization frame? Can the host use this relationship to check for errors?


Thanks for considering my questions further.
-Kurt
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi zoompig,

There is very little information on the CAN BSL from the XMC4000 reference manual for me to answer your question. Let me check if I can find some documents regarding the SSW for CAN BSL.

Are you building a host communication software to interact with the XMC?

Best Regards
Travis
0 Likes
User5581
Level 3
Level 3
Hello Travis,

Yes, we are looking to write some host software as well as a bootloader using CAN BSL. If you could find a little more detail on this protocol than is now available in the reference manual, it would be much appreciated.

Thanks,
-Kurt
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi zoompig,

You can set your desire BTR in the initialization frame. Please check your message box

Best Regards
Travis
0 Likes
User15148
Level 1
Level 1
Hi Travis,

I'm also suffering with the CAN BSL (?p=18258).
Do you have some documents that could assist me in debugging the invocation?

Thanks!
Matthias
0 Likes
SunYajun
Employee
Employee
10 replies posted 5 replies posted Welcome!
in the appnote you can find detailed info:
https://www.infineon.com/dgdl/Infineon-AP32269_XMC4000_CAN_BSL-AN-v01_00-EN.pdf?fileId=5546d4624933b...
https://www.infineon.com/dgdl/Infineon-AP32269_ApplicationExample_XMC4000_CANBSL-AN-v01_00-EN.exe?fi...
an example:
#define CANLoader_16K 0x4000 //(C000-FFFF, 16Kbyte)
#define DATA_MSG_ID 0x0556
#define ACK_MSG_ID 0x0557

CAN_MO1->MOAR = (0x4000 | (0x555<<2))<<16; // ID=0x555
CAN_MO1->MODATAL = (0x4000 | ACK_MSG_ID)<<16 | 0x5555 ; // load MO1 data register low
CAN_MO1->MODATAH = (0x4000 | DATA_MSG_ID)<<16 |(CANLoader_16K)/8; //load MO1 data register high
0 Likes