2014-07-07 07:20 AM
Hi!
How can I tell the STM32F303 bootloader to run application code from flash memory? After reading AN3155, I tried the following byte sequence (''>'' indicating bytes sent to the serial interface, ''<'' bytes received from the interface):>: 0x7f (baud rate detection)<: 0x79 (ACK)>: 0x21 0xde (''go'' command + checksum)<: 0x79 (ACK)>: 0x08 0x00 0x00 0x00 0xf7 (address + checksum)<: 0x1f (NACK)I don't understand why the ''go'' command fails to run code at address 0x08000000. Which command should be sent to launch application code? Does anything else need to be setup before executing the ''go'' command? Does the ''go'' command only work if flash memory was actually written to in the same bootloader session? I tried at 9.6 kbaud and 100 kbaud and got the same results for both.Thanks & kind regards,Markus #stm32f303-usart-bootloader-go2014-07-07 07:50 AM
Probably because the checksum is wrong? The address frame uses a simple XOR
Try 0x08 0x00 0x00 0x00 0x08 (address + checksum)2014-07-08 02:22 AM
Thanks a lot, this solved the issue! Since the byte sequence for the ''go'' command is explicitly given as ''0x21 0xde'', I took it for granted that the XOR checksum has to be 0xff and didn't assume that other data blocks (start address) are handled differently (requiring XOR checksum 0x00). Actually the application note document AN3155 is also incorrect on this since it states that ''for each command the host sends a byte and its complement (XOR = 0x00)'' (should be 0xff here).
Kind regards,Markus2014-07-08 07:25 AM
I haven't read all the documentation, but the original AN2606 was relatively clear about a lot of this stuff. And it described the address checksumming in the READ command immediately prior to the GO command.
I'm not sure why they even said XOR=0x00 for the command and it's complement, as it's irrelevant, unless you think of it in terms of what it contributes to a running sum.2014-07-09 04:47 AM
Hello Clive,
I have an issue with the communication of the Bootloader through an I2C in STM32F401C-Disco Kit.
The pins of the bootloader configured as BOOT0 = '1' and PB2 = '0' (That used as BOOT1). The I2C configured as I2C1 PB6 = 'CLK' and PB7 = 'DAT'. When I send the Slave Address '0x72' (as 7 bits) through the I2C I get 'Nack' instead of 'ACK' and the communication is aborted. (See attached diagram) I'm Using a standard I2C protocol (100KHz or 200KHz). Did Imiss somthing? Thanks for your helpI haven't read all the documentation, but the original AN2606 was relatively clear about a lot of this stuff. And it described the address checksumming in the READ command immediately prior to the GO command.
I'm not sure why they even said XOR=0x00 for the command and it's complement, as it's irrelevant, unless you think of it in terms of what it contributes to a running sum. ________________ Attachments : I2C.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0nL&d=%2Fa%2F0X0000000bdz%2FVXcZNA7ithdy_cnUOLesAOIsNTTFcqow87uyHDEEn9c&asPdf=false2014-07-09 05:20 AM
I've had no cause to use the I2C mode.
I would suggest you try not shifting 0x72 (0xE4) in the fashion you have.2014-07-09 05:43 AM
Thanks for your quick answer.
Do you know where or how I can get help about the I2C mode? I did not find documentations regarding the protocol of the I2C Bootloader.2014-07-09 05:53 AM
A quick Google brought up this
Depends on the type of help you're looking for, if you want to pay for it, and your relationship with local ST reps and FAEs.2014-07-09 06:59 AM
Thanks again Clive.
If I will find a solution, I will upload it to the forum.