HCS08 and flash access (writing, erasing, protection...)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HCS08 and flash access (writing, erasing, protection...)

ソリューションへジャンプ
2,962件の閲覧回数
vcz
Contributor II

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

ラベル(1)
0 件の賞賛
返信
1 解決策
1,268件の閲覧回数
vcz
Contributor II

 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 !

 

 

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,268件の閲覧回数
vcz
Contributor II
I have forgoten to say that I'm using sdcc to cross compil my project....
0 件の賞賛
返信
1,268件の閲覧回数
J2MEJediMaster
Specialist I

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

0 件の賞賛
返信
1,269件の閲覧回数
vcz
Contributor II

 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 !

 

 

 

 

0 件の賞賛
返信