Standard Software Flash Driver For S12G

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Standard Software Flash Driver For S12G

1,298 Views
Derrick_Bean_Lee_33
Contributor I

I get firmware S12G_VR_NVM_SSD.After compiling the project, I generate a series of arrays and  .sx files, such as FlashInit_C, FlashProgram_C, or flashinit.sx, etc.How do I merge these .sx files or arrays into an S19 file?Since I want to run in RAM, I need to locate the address to the RAM of S12G128, and the boot RAM address is 0x3000. For Help

0 Kudos
1 Reply

1,244 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

 

If you want to merge srecord files the first thing you should consider is whether the address in both srecords is not overlapped.

After that, there are a few methods of how you can merge the files, please, refer to this link:

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/merge-Bootloader-and-application/m-p/957543

From your description is not clear which addresses are included in your .sx files. So, please, keep in mind that when you will load the file into the flash by your project use the address space which empty/ not used by your project to avoid overwriting the flash addresses of a project and your srecord.

Note: The attached file can help you to easily recalculate checksum in a specific record. just copy your record to input and change, for example, the address if it is needed and the checksum will be recalculated.

 

About the run in RAM question.

I suggest looking at the SW of  AN4258. In this example, a segment in RAM is created. This segment is used for functions that must be executed from RAM memory. These functions are stored in flash memory in RAM_CODE_SEG and are copied to RAM memory after startup. 

Please, refer to .prm file located here: AN4258SW\Bootloader_S12\prm

Also, you can find this function "static void CopyCodeToRAM(void)" in the AN4258SW\Bootloader_S12\Sources\main.c 

After that, when the code is loaded at the required address you can jump at that address. The AN4258 is a bootloader example code and uses jump at a certain address (address of an application) after the reset in the StartS12.s file. You can use it as a reference.

 

I hope it helps.

Best regards,

Diana

0 Kudos