I m new in writing a bootloader for freescale 12xep100 microcontroller.I get from the newer application note AN4258 Serial Bootloader for S12(X) Microcontrollers Based on 180 nm Technology.I hace tried the demo application,it was successful.My own program can not work when i try it.I do not know how to modify it .please help me,thank you!
There is chapter for AN4258:
6 How to write a user application
You must ensure that the user application does not interfere with bootloader area 0xF000-0xFFFF.
If interrupts are used:
Could you please confirm that you create your application according this procedure?
In default prm file is defined reset vector VECTOR 0 _Startup.
This will generate record in output s19 file like S105FFFEC0003D.
Since address 0xFFFE is already occupied by bootloader reset vector, please erase this line from your application s19 file.
Note: S105FFFEC0003D decoding:
S1 is type of record (16bit address),
05 is size of record in bytes,
FFFE is address of reset vector,
C000 is content of reset vector (start address of your applicaction).
3D is CRC checksum.
When we use ROM_4000 segment (0x4000–0x7FFF) in user application we have to disabling the optimization that changes JSR's into BSR's = the project settings will include the following compiler option: -Onb=b (Go to standard setings (Alt+F7), compiler for HC12, add command line argument -Onb=b (if missing)).
thank you ! I have createdmyapplication according the procedure,at the same time, my prm file defined reset vector VECTOR 0 _Startup too. The s19 file of the demo application also has record like S105FFFEC0003D,Even if i erase this line from my application s19 file,it does not work.Is there other place also needing to configure?
Did you convert your s19 file by SRecCvt tool (according chapter 7)?
I have solved the questions,thank you!
I tried unsecuring using Unsecure12. I changed the OSC Frequency field to 16000000, since I have a 16MHz crystal on my board. Then, I click the "Unsecure" button, and I get the following response.
Searching for Interface Speed .......
(after several seconds)
ERROR - Communicating with target
Appropriate interface speed not found.
yes,I do.now i have a new problem,i merge the user application and bootloader together as "8 How to merge the user application and bootloader ",I can't download the new program via BDM device.I confirm that I Add the command ' FLASH NOUNSECURE' into the file 'P&E_Multilink_CyclonePro_Preload.cmd',Why such a situation would happen,What should I do now?