Bootloading (arrayID = 0x40)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
jofic_334026
Level 3
Level 3
First like received

I'm working on a bootloader.  I'm following the recommended communications flow found in multiple application notes.  I'm able to program most of the flash rows until I get to arrayID = 0x40.  The GET_FLASH_SIZE command returns a start and end row of 23 and 255 for this arrayID but the .cyacd file indicates row 0 should be programmed.  Is there something special about arrayID = 0x40?

   

Here's a snippet from my cyacd file:

   

:0000EC01200000000008000000000000000000000000000000090000000000000000000000000000000A0000000000000000000000000000000B0000000000000000000000000000000C0000000000000000000000000000000D0000000000000000000000000000000E0000000000000000000000000000000F000000000000000000000000000000F8B500BFF8BC08BC9E4670473D19000081340000F8B500BFF8BC08BC9E46704719190000B8EC000008C1FF1FF0000000E0390000000000000C005A00145300000C005A00F85000000C005A00C04C00000C005A00A44A00000C005A00DC4E00002A005A006A9300000100000038C2FF1FFF0000002A005A002EA2000000000000000000000000000000000000000000000000000000000000000000000A
:0000ED01202A005A0018C700002A005A00F2B000002A005A00447D00002A005A00925C00002A005A007ACE00002A005A0054B800002A005A00A68400002A005A00F46300002A005A00CC9A00002A005A00B6BF00002A005A0090A900002A005A00E27500002A005A00305500002A005A00088C00003C005A00DCD500003C005A00566B00003C005A0068E000007F800000010000000000E880D0010100420000008014EF03FF00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000B4
:0100FF0120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AA111900001800000000D5000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001D
:4000000010020100010000FF01020304050607080980
:40000100100A0B0C0D0E0F10111213141516171805AB
:400002001003FF0100FFFFFFFFFFFFFF0100FF0100B1
:40000300100005FFFFFFFFFFFFFFFFFFFFFFFFFFFFB6

   

The first 2 rows are arrayID = 0. The next row has arrayID = 1.  My bootloader works fine up to this point.  The fourth line starts arrayID = 0x40.  My bootloader breaks here, 

0 Likes
8 Replies
jofic_334026
Level 3
Level 3
First like received

I ignored the error and programmed the row even though it was outside the bounds of what the GET_FLASH_SIZE command says.  The row checksum checks out so I'm assuming what I did was ok.  Was this the correct thing to do?

0 Likes
Anonymous
Not applicable

Hello Fix,

   

 

   

From your .cyacd file, I see that the array ids 0x00 and 0x01 have 0x120 (288) bytes of data in each row, while the array id 0x40 has only 0x10 (16) bytes of data in each row. Every flash row can hold 288 bytes of data (256 data bytes plus 32 bytes for either error correcting codes (ECC) or configuration data). The .cyacd file seems wrong as it contains only 16 bytes of data in array id 0x40. As you might know, you can only program the Flash on a  Row basis and one flash row contains 288 bytes (256 + 32). 

   

 

   

Also, there are only 4 arrays in PSoC 5LP, not 0x40 arrays. Not sure how the number 0x40 came here.

   

 

   

Please let me know the answers to the following:
1. How is the .cyacd file generated?
2. What is the version of PSoC Creator?
3. Attach the project for review?

   

 

   

Regards,

   

Saheem

0 Likes
lock attach
Attachments are accessible only for community members.

1. How is the .cyacd file generated? It just is.  I didn't change any settings in PSoC Creator.

   

2. What is the version of PSoC Creator? v3.1

   

3. Attach the project for review? See attached

0 Likes
Anonymous
Not applicable

The lines starting with ":40" is the EEPROM data and not the Flash data. See the .cydwr file EEPROM  tab for this data. Let me check and get back to you on how to bootload this...

   

 

   

Regards,

   

Saheem

0 Likes
Anonymous
Not applicable

Fix,

   

 

   

Do you need the EEPROM to be initialized during bootloading? Else you can uncheck the "Include EEPROM in firmware" in EEPROM tab of .cydwr file and bootload the flash data.

   

 

   

Regards,

   

Saheem

0 Likes

Yes, I do need the EEPROM initialized.  If I ignore that the row is out of bounds and program a row (in array 0x40) the checksum is returned correctly and the EEPROM data appears to be properly initialized as well.  Perhaps Cypress could document the EEPROM better in the app notes?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Maybe I'm wrong, but array ID 0 (and some following) should never be programmed by the bootloader, since this is the start of cyboot and the bootloader itself. Instead the first row to be programmed should be behind the bootloader's end.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Bob,

   

 

   

There are 4 arrays in PSoC 5LP and each array has 128 or 256 rows depending on the part. As you can see from the .cyacd file in post 1, the data is written to row 0xEC and beyond. Thus the initial 0xED rows of array 0 are used by the boot code and the bootloader. Following KBs will be helpful:

   

http://www.cypress.com/knowledge-base-article/psoc-3-psoc-4-and-psoc-5lp-flash-memory-organization-a...

   

http://www.cypress.com/knowledge-base-article/format-cyacd-file-relating-psoc-35-bootloaders

   

 

   

Saheem

0 Likes