cancel
Showing results for 
Search instead for 
Did you mean: 

question aboue bootloader Write_Memory command

Snaku
Associate III

Hi,

I am tring to write data by the FDCAN bootloader of system memory, my target is STM32H563.

Snaku_0-1762338250957.png

Now, I can read the device ID, perform the mass erase command, but I can't write data to SRAM/Flash, the FDCAN bootloader doesn't response any CAN message after the Write_Memory command. 
Below picture is the CAN message log when I try to write 64 bytes data to flash at 0x0802_0000.

Snaku_1-1762338502807.png

I also check the 'Write_Unprotect' command, so the MCU is not write protect.
Do I miss something have to do?
Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

You've told it you're writing 256 bytes but you've only sent 64. It's waiting for the rest.

TDK_0-1762350139617.png

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

6 REPLIES 6
TDK
Super User

You've told it you're writing 256 bytes but you've only sent 64. It's waiting for the rest.

TDK_0-1762350139617.png

 

If you feel a post has answered your question, please click "Accept as Solution".
Snaku
Associate III

Hi TDK,

Yes, you are right, the FDCAN bootloader is waiting other three 64 bytes data frames.

Thanks for your help

Snaku

Snaku_0-1762390258084.png

 

Ade J.2
Associate II

Hi @Snaku 

I'm using the H533, but I'm struggling to get it into the FDCAN loop of the system bootloader.

How did you do that? According to AN2606, our MCU's are using the same FDCAN peripheral/settings. 

Thanks.

Hi Ade,

  1. The simplest method is to pull up the BOOT0 pin before resetting the MCU.
  2. If you want to use a function call to jump to the system bootloader, you can see the LOADER_Run( ) in the 'OEMiROT_Appli_TrustZone' example project. https://wiki.st.com/stm32mcu/wiki/Security:How_to_adapt_a_user_application_to_ROT_for_STM32H5
/**
* @brief Perform Jump to the BootLoader
* @retval None.
*/
void LOADER_Run(void) { ... }

Regards,

Snaku

Ade J.2
Associate II

Hi @Snaku 

I'm not having trouble to enter the system bootloader itself.

 

It's rather entering the FDCAN loop of the system bootloader. I tried a all kinds of combinations to "activating" it, as described in AN5405. But my messages got never a reply or even being ACK'ed.

While in my user application, I used the same peripheral (pins) and settings as the system bootloader expects and then I can communicate perfectly.

What is your sequence of "activating" the FDCAN loop after it started the system bootloader?

 

I'm at this stage:
image.png
Regards,

Arnold

Hi Ade,

There is no special sequence for starting the FDCAN loop.

Please check the following two points, which I have encountered problems with before:

1. Prevent other interfaces from having the opportunity to initiate their loops, such as external pull-up resistors on the unused UART_RX pin.

In AN2606: "It is recommended to keep the RX pins of unused bootloader interfaces (USART_RX, SPI_MOSI, CAN_RX and USB D+/D- lines if present) at a known (low or high) level at the startup of the bootloader (detection phase). Leaving these pins floating during the detection phase might lead to activating unused interfaces."

2. CAN-FD bit timing, Nominal bit rate is 250kbps, Data bit rate is 1Mbps, both require accurate 80% sampling point.

Regards,

Snaku