ezport write_section fails/bugs

cancel
Showing results for 
Search instead for 
Did you mean: 

ezport write_section fails/bugs

134 Views
alexeyusoltsev
Contributor IV

 Hi,

I am trying to write firmware from flash of 1 kinnetis device to another. And I had success until my aim firmware size grown up.(20550 bytes by far)

I've made "write section" command followed by read function to check correctness. I got difference at address 0x4001 so having 0x4000 bytes written correct.(need to say that something was written after 0x4000. it is not 0xff bytes)

Ok, I thought it was a fail because of RAM or sector sizes. I've made "write_sector"(with varying sector size) function and "check_sector" functions. It looks like working(it writes and checks at a sectors address with no issues) but when I check the whole firmware I got difference just after first sector at 1st byte.

 Thinking of root of my problem it seems like wrong address been calculated. Am i correct that 32-bit aligned address is a simple address that has 2 LSB's equal to 0?

So to start a write at 0x2000 i need to do:

  ez_transmit(0x02);  //programm sector opcode
  ez_transmit(0x00);
  ez_transmit(0x20);
  ez_transmit(0x00);

 Attached file give a view of a code used.(nonrelevant part is deleted)

0 Kudos
3 Replies

47 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

Could you let us know what's your target Kinetis product part number?


Have a great day,
Mike

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

47 Views
alexeyusoltsev
Contributor IV

 Hi Mike,

mkv31f128. I cant attach python script that converts my .bin to .c file. But I've checked with binary viewer that it did work.

Regards,

Alexey.

0 Kudos

47 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Alexey,

From KV31F128 reference manual, the EzPort buffers the data in System RAM before sequentially
moving the data into flash using the Program Longword command. For this reason, the number of bytes to be programmed must be a multiple of 4 and up to one flash section can be programmed at a time.

The KV31F128 Flash sector size is 2KB.

EzPort command [Flash Section Program]  Address must be 32-bit aligned (two LSBs must be zero).

Thank you for the attention.


Have a great day,
Mike

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos