Hello all.
I'm working on a mc9s08aw16 HCS08 based MCU.
I have to program a bootloader and a firmware.
I choose to place the firmware between 0xC000 and 0xEEEE and the bootloader between 0xF000 and 0xFFAF.
I have made a small function which transfert to RAM the code used to write/erase flash
But I still not succed in erasing and writing to flash
I program the 0xFFBF byte (NVOPT) with 0xFE so the MCU should be unsecured (programming via Cyclone Pro)
I'm lost between all the register related to flash.
More precisly with the NVBACKEY registers, KEYACC bit, SEC0 bits...
To sum up, is there anybody who can explain me what I have to do with those register to succeed in my goal.
Thanks a lot
Solved! Go to Solution.
Hello.
Thanks a lot for your answer. I already have the AN2295 but I didn't find what I want in it.
Nevertheless, I have re-written my code and now, it works ! I changed the way to execute from the RAM and it's more efficient and easy understanding.
Indeed, instead of making a routine writing to ram the opcode dynamically, I use a tab with statical opcode in it and then jump to the tab address in ram... (I find this idea in a page of this forum !)
Thanks !
This sort of task has been discussed many times in the forums. Do a search on "bootloader" using the search box at the bottom left of this web page. Also, search for App Note 2295 (type "AN2295" into the Enter Keyword box at the top right of this web page). It covers a serial bootloader, but it's a good place to start.
---Tom
Hello.
Thanks a lot for your answer. I already have the AN2295 but I didn't find what I want in it.
Nevertheless, I have re-written my code and now, it works ! I changed the way to execute from the RAM and it's more efficient and easy understanding.
Indeed, instead of making a routine writing to ram the opcode dynamically, I use a tab with statical opcode in it and then jump to the tab address in ram... (I find this idea in a page of this forum !)
Thanks !