In Application Programming with GSM and External EEPROM

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

cross mob
lock attach
Attachments are accessible only for community members.
moro_1580446
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi everybody.I want to do ask a question and please guidance me to solve my problem.

please see my project.i have a IOT project with CY8C5888LTI. It is contain some feature like GSM ( Quectel M95 ) it connected to CY8C5888LTI with uart and FRAM ( eeprom ) connected with i2c to CY8C5888LTI and some other parts for working function.Its work well.Sometimes need to change some feature in program and reprogramming psoc5.

so my problem is how changing program in working over the air!!!

I know should use bootloader and bootloadable and when i need change program using UART or any peripheral with bootloader Host to update project firmware by "Bootloader Host Tool" but because i have not ability to access to device,so i cant use that.

I think the best way is use eternal memory from my board like EEPROM(I2C) and GSM(with network) to doing my purpose.

I can download new bootloadable.cyacd from network or FTP by GSM and then write on external EEPROM.

I try to use some sample code like(for example model) Hackster.io but this file project have build Error (attached error build).

I do not know how i can use CyBtldrCommWrite() or CyBtldrCommRead() in psoc creator without Error.

1- why this function not recognize?

2- My question exactly is about how writing new bootloadable.cyacd correct that is understandable for bootloader?

3- Another question how can i configured bootloader to check and read new bootloadable.cyacd from external EEPROM and then write it to internal FLASH?

(I know should i use custom interface in bootloader but i do not know how i can set bootloader to programing new program from external EEPROM)

4- Third question is it possible to do this purpose with internal EEPROM of CY8C5888LTI?

this question maybe answered in some communication discussion but those discussion did not use custom interface in bootloader.I want to do that by custom interface in bootloader.

please help me and thanks a lot for attention...

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

1- why this function not recognize?

PSoC 4 EEPROM Bootloader Example  - Hackster.io reference example is developed using an older version of bootloader component. The component declaration and definition have been modified in later revisions of bootloader component. Please use the earlier version of bootloader component to build this reference example ie., bootloader v1.20 (Project> Update Components; Select bootloader v1.20).

2- My question exactly is about how writing new bootloadable.cyacd correct that is understandable for bootloader?

The Cypress application and code data (.cyacd) file format stores the bootloadable portion of a design in following format;

The header record format is as follows:

[4-byte SiliconID][1-byte SiliconRev][1-byte Checksum Type]

The data records have this format:

[1-byte ArrayID][2-byte RowNumber][2-byte DataLength][N-byte Data][1-byte Checksum]

Please refer to section: Bootloader Application and Code Data File Format in Bootloader Component datasheet for more details.

The bootloader host needs to translate the cyacd file content to the bootloader command-response protocol. Bootloader component will decode the commands and perform operations (program specified flash row, erase specified flash row etc.,) appropriately. Please refer to Appendix C. Host/Target Communications to understand the communication flow.

3- Another question how can i configured bootloader to check and read new bootloadable.cyacd from external EEPROM and then write it to internal FLASH?

As you have rightly figured out, please use the custom interface in Bootloader component. PSoC 4 EEPROM Bootloader Example  - Hackster.io demonstrates the steps,

  1. Write cyacd content to external EEPROM (using ACD2HexConvertor.exe and bootloadable project)
  2. Validate the EEPROM image (bootloadable project)
  3. Bootload from EEPROM region (bootloader project).

Bootloader functions have been modified to read/write from EEPROM instead of communication port. Refer to ...\Bootloader.cydsn\communication.c for implementation details.

4- Third question is it possible to do this purpose with internal EEPROM of CY8C5888LTI?

CY8C58LP Family comes with 2 KB EEPROM. If your bootloadable image size is lesser than 2kB, you can use this region as well.

EEPROM and device flash region are accessed using System Performance Controller (SPC). Please read and store EEPROM content in RAM block wise. Later, call flash write API to update device flash region. 

View solution in original post

12 Replies
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

1- why this function not recognize?

PSoC 4 EEPROM Bootloader Example  - Hackster.io reference example is developed using an older version of bootloader component. The component declaration and definition have been modified in later revisions of bootloader component. Please use the earlier version of bootloader component to build this reference example ie., bootloader v1.20 (Project> Update Components; Select bootloader v1.20).

2- My question exactly is about how writing new bootloadable.cyacd correct that is understandable for bootloader?

The Cypress application and code data (.cyacd) file format stores the bootloadable portion of a design in following format;

The header record format is as follows:

[4-byte SiliconID][1-byte SiliconRev][1-byte Checksum Type]

The data records have this format:

[1-byte ArrayID][2-byte RowNumber][2-byte DataLength][N-byte Data][1-byte Checksum]

Please refer to section: Bootloader Application and Code Data File Format in Bootloader Component datasheet for more details.

The bootloader host needs to translate the cyacd file content to the bootloader command-response protocol. Bootloader component will decode the commands and perform operations (program specified flash row, erase specified flash row etc.,) appropriately. Please refer to Appendix C. Host/Target Communications to understand the communication flow.

3- Another question how can i configured bootloader to check and read new bootloadable.cyacd from external EEPROM and then write it to internal FLASH?

As you have rightly figured out, please use the custom interface in Bootloader component. PSoC 4 EEPROM Bootloader Example  - Hackster.io demonstrates the steps,

  1. Write cyacd content to external EEPROM (using ACD2HexConvertor.exe and bootloadable project)
  2. Validate the EEPROM image (bootloadable project)
  3. Bootload from EEPROM region (bootloader project).

Bootloader functions have been modified to read/write from EEPROM instead of communication port. Refer to ...\Bootloader.cydsn\communication.c for implementation details.

4- Third question is it possible to do this purpose with internal EEPROM of CY8C5888LTI?

CY8C58LP Family comes with 2 KB EEPROM. If your bootloadable image size is lesser than 2kB, you can use this region as well.

EEPROM and device flash region are accessed using System Performance Controller (SPC). Please read and store EEPROM content in RAM block wise. Later, call flash write API to update device flash region. 

lock attach
Attachments are accessible only for community members.

Thanks dear Geonam for attention and reply. I changed bootloader and i2c version to older and solved building Error(I dont know why was it occur,By regular, new component must be better than older!!!). I am building bootloader and program on psoc4 and then build second bootloadable and changed .cyacd file to hex file and copy code to heximage.h file of first bootloadable then built it. Building first bootloadable and program in psoc4 ,when i press key(P0.7) it going to writing heximage.h mode, but it is hang constant. I set correct address on EEPROM and not changing code of PSoC 4 EEPROM Bootloader Example  - Hackster.io .

1- I do not know where is my mistake?(I think if ! i can fix and use Hackster.io it is very useful for me)

2- Can you give me more about custom interface bootloader and example code or more explain to use that?

for example for using I2C in master mode and use in bootloader to read and write new bootloadble code from external eeprom?

Thanks for attention...

0 Likes

What is the external EEPROM MPN used in your application?

You can understand custom bootloader implmentation and function details from Chapter 10. Adding Bootloader Support (Advanced) of PSoC Creator Component Author Guide. Go to PSoC Creator, Help > Documentation > Component Author Guide. For implementation related infomation, please go through the I2C master-bootloader implementation in PSoC 4 EEPROM Bootloader Example  - Hackster.io .

I am using FRAM of fujitsu, part number is mb85rc256vpnf...

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

Now I can running PSoC 4 EEPROM Bootloader Example  - Hackster.io correct.this example did not write all of new bootloadable.hex correct on EEPROM so i writing all of .hex by another program and then with bootloader update bootloadable.Now i have another question.

1-I am using psoc5 and i want to modify code of above example on psoc5,but psoc creator v4.2 and bootloader v1.6 has some different configuration in CyBtldrCommWrite() and CyBtldrCRead() function.can you help me to modify my psoc5 configuration code to run psoc5 and bootloader function on custom interface mode?

2-I am attached project file bellow please checked it and say me where is my mistake?

Thanks for attention...

0 Likes
  1. Recently shared bootloader-bootloadable projects use bootloader v1.60. Please clarify whether you are facing any issues with them.
  2. Hackster project uses an earlier version of bootloader component. Once you update the device (Project > Device Selector; Select appropriate PSoC 5LP device) in the working PSoC 4 project, are you facing any issues?
0 Likes

I want to do exactly Hackster project but replace with psoc5.my question is exactly how can i run psoc5 like psoc4 in Hackster project?

I can not use Device Selector and update bootloader component,because psoc creator in build process give some error. I am try to use

Custom communication interface support for PSoC 3 and PSoC 5 bootloaders - KBA203609 but in compile give error. Can you say me how can i write CyBtldrCommWrite() and CyBtldrCRead() function in my project to build correct and doing my purpose?

0 Likes

Which is the PSoC Creator build version? Please share the build error screenshot.

0 Likes

I am using psoc creator 4.2 and bootloader component version is 1.6.

it has not error in bilding or programming.but it does not get new app from ext eeprom. what do u think about it?where is mistake in code?

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

I send new bootloadable(new firmware) by gsm or any other peripheral, then write it on ext eeprom(I try by hand too),then i want to run bootloader to read new firmware and write it in int flash then run with new firmware.I cant write API function of bootloader in custom mode(EXT EEPROM is I2C).I try to get code from BLE_Over_The_Air.cywrk.Archive01 sample code(exactly for CyBtldrREAD and CyBtldrWRITE API in bootloader) but its going to HALT. Now i share it with u.it does not get app from external eeprom.please check it and tell me where is mistake?

I think my meta data is incorrect,or my writing method is not true. please guide me?

0 Likes

another question is why in CustomInterface.c line number two has undefined error?how can fix?

buffer[CI_CMD_ADDR      ] = CI_COMMAND_PROGRAM;

buffer[CI_DATA_ADDR     ] = CY_FLASH_GET_MACRO_FROM_ROW(appFirstRowNum);

buffer[CI_DATA_ADDR + 1u] = LO8(appFirstRowNumInArray);

buffer[CI_DATA_ADDR + 2u] = HI8(appFirstRowNumInArray);

thanks for attestion...

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

I try to get code from BLE_Over_The_Air.cywrk.Archive01 sample code(exactly for CyBtldrREAD and CyBtldrWRITE API in bootloader).now i share it with u.it does not get app from external eeprom.please check it and tell me where is mistake?

0 Likes