cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0308DISCOVERY Bootloader Go-Command

franz2399
Associate II
Posted on June 06, 2014 at 11:00

Hi

The bootloader GO command doesn�t work as expected. Generally AN3155 is wrong here, because the second ACK after the address isn�t send also on other chips (STM32F2, STM32F4, �), but the jump works there.

Test system:

Hardware

:

STM32F0308DISCOVERY

http://www.st.com/web/en/catalog/tools/PF259100

Firmware

http://www.st.com/web/en/catalog/tools/PF259447

-> STSW-STM32140

programmed with

JTAG

Serial tracing after reset (bootloader mode enabled)

No

Packet

Start Bit

Data bytes

Parity Bit

Stop Bit

Error

Start Time

End Time

1

Data

0

7F

1

1

-

101,9ms

102ms

Enter bootloader

1

Data

0

79

1

1

-

102ms

102,1ms

2

Data

0

21

0

1

-

134,3ms

134,4ms

Start Go

3

Data

0

DE

0

1

-

134,4ms

134,5ms

2

Data

0

79

1

1

-

134,5ms

134,6ms

4

Data

0

08

1

1

-

154,2ms

154,3ms

Send Address

5

Data

0

00

0

1

-

154,3ms

154,4ms

6

Data

0

00

0

1

-

154,4ms

154,5ms

7

Data

0

00

0

1

-

154,5ms

154,6ms

8

Data

0

08

1

1

-

154,6ms

154,7ms

3

Data

0

79

1

1

-

154,7ms

154,8ms

Confirm receiving  address and checksum

Missing confirmation for valid address and checksum

After that sequence, the MCU stays in bootloader!

referenced

m

anuals

AN2606 Application note STM32� microcontroller system memory boot mode Rev 5

AN3155 Application note USART protocol used  in the STM32� bootloader Rev 17

Additional information

WR 7F

RD 79

WR 00 FF

RD 79

RD 0B

RD 31

RD 00 01 02 11 21 31 44 63 73 82 92

RD 79  

Version: 3.1

Supported Commands:

ExtendedEraseMemory   True

EraseMemory   False

ReadMemory   True

ReadoutProdect   True

Go   True

ReadoutUnprodect   True

WriteProdect   True

WriteUnprodect   True

WriteMemory   True

GetID   True

GetVersionAndReadProtectionStatus   True

GetVersionAndAllowedCommands   True

Any ideas would be most welcome.

Thanks

#stm32f030-bootloader-go
1 REPLY 1
Posted on June 06, 2014 at 17:31

I guess I'd start by looking closely at what code I was executing, and if there is a watchdog you need to keep kicking. Technically the code could return to the System Loader, it could watchdog, or hard fault. Code called in flash is probably not mapped at zero, but I'd need to do more analysis.

From another F0 ROM

1FFFF334 LOC loc_1FFFF334_GoCmd: ; Xref 1FFFF294
1FFFF334 F7FF FF5D bl sub_1FFFF1F2_GetUsartDWORD
1FFFF338 4604 mov r4, r0
1FFFF33A F7FF FDD1 bl CheckMemRegion
1FFFF33E B2C0 uxtb r0, r0
1FFFF340 2802 cmp r0, #2
1FFFF342 D001 beq.n loc_1FFFF348
1FFFF344 2803 cmp r0, #3
1FFFF346 D10A bne.n loc_1FFFF35E_SendNACK
1FFFF348 LOC loc_1FFFF348: ; Xref 1FFFF342
1FFFF348 F7FF FD96 bl sub_1FFFEE78
1FFFF34C F7FF FCB9 bl sub_1FFFECC2_EnableInt
1FFFF350 6865 ldr r5, [r4, #4] ; +4 PC
1FFFF352 6820 ldr r0, [r4, #0] ; +0 SP
1FFFF354 F7FF FCB0 bl sub_1FFFECB8_SetMainStack
1FFFF358 47A8 blx r5 ; GO
1FFFF35A E77F b.n loc_1FFFF25C_CmdLoop

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..