cancel
Showing results for 
Search instead for 
Did you mean: 

flash erase & costume bootloader problem

mizevel
Associate II
Posted on November 22, 2009 at 07:39

flash erase & costume bootloader problem

1 REPLY 1
mizevel
Associate II
Posted on May 17, 2011 at 15:05

Hello all,

We have a problem with our project.

we use:

- a REva motherboard v3.3 with RLink

- a REva STM8S208RB daughter board.

- Windows XP, Service Pack 3

- Ride Ver. 7.24.09.0251

- RKit-STM8 Ver. 2.24.09.0238

activated for 16K code.

1. we send using a pc terminal software 22bytes all are 'B', so the software enters boot_process() proc.

In boot_process() proc. there is a while command which wait for communications from the terminal. If no communication arrives the software should stay there, but the the program counter gets the value of 0x6000 and the software gets stuck, the internal bootloader of the STM8 is not enabled, also the watchdog is not enabled.

[we discovered the above since this application should be in 2 MCUs, when one is the master (sending its own application) and the other is the slave (receiving the application and program it to the flash), we tried to debug our bootloader function (initiated by BT5 of the evaluation board) and noticed that once the application is in the boot_process() proc. it didn't receive the 132 bytes communication.]

The boot_process() proc. has the directive ''at 0x8080 code'', if we mask the directive the bug do not occur, but then we won't have control regarding the memory space the procedures we want to protect will occupy. we tried to move the procedure to the end of the code (''at 0xC000 code'') the bug repeated itself.

2. A second problem we encountered: (after we mask the ''at 0x8080 code'' directive so the procedure will be able to be debugged), the procedure gets number of blocks to erase within the flash, the erase is done with a For loop until all selected blocks are deleted, the proc. will erase 4 or 5 blocks and then the program counter gets a value like 0xFEFF or something like that and the software gets stuck. the code in the erased section is not in use by the flash and boot functions.

Hope you can help us

Best regards

Igal