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.
Manoj_Kumar
Level 3
Level 3
50 sign-ins 25 replies posted 10 questions asked

I am using the CY8CKIT-062S2-43012 and trying to write and read the data in emulated EEPROM storage.

The issue I am facing is using EEPROM using DFU.

In the CM4 Blinky code ,I read few bytes from EEPROM and later check ,if the content matches the pattern I have written. If not then I try to write the content. It does not work.

 

The same code in non DFU mode works.

I have used LED's to indicate the state of program.

Initially the blue led indicates that program started working, and for first time the red led will be on which indicate that program is writing the data and once red led is turned off it indicated writing of data ended.

Orange led indicate that it has found the pattern and the if condition is false and now the else block is writing the data.

I have attached both project please refer that.

Hello_World.zip is stand alone project which works as expected.

Basic_Device_firmware_Upgrade.zip is the DFU code where it does not work.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Rohan136
Moderator
Moderator
Moderator
100 replies posted 25 solutions authored 10 likes received

Hi @Manoj_Kumar ,

 

We discovered 2 issues in the project.

1. The CM0 core was not calling bsp init and interrupt enable after finishing bootloading of the new image. As a result CM0p core is not fully initialized and cannot run requests from CM4 to write to flash.

2. The allocated address for RAM is same for CM0p and CM4. 

Here are the fixes made in main.c of CM0p and dfu_cm4_app1.ld in CM4. After this changes the eeprom works fine.

 

Regards,

Rohan

View solution in original post

0 Likes
13 Replies
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Manoj_Kumar ,

You have taken the Basic DFU Code example and want to run the attached Hello World project as Blinky Application. Is this correct?

If it is yes, Please confirm on this I.e. you are not changing the Bootloader project right?
and also please let me know what and all changes you made to the existing  Blinky Application.

Thanks and regards,
Sidramesh

0 Likes

Yes Sidramesh, That's the basic DFU example.

We are just changing the App not bootloader.

i.e, We want to get EEPROM working in our Blinky app not in boot loader and nor in any stand alone project..

Standalone in hello world project EEprom works. Same code copied in Blinky does not work.

0 Likes

Hi @Sidramesh_S , any update?

0 Likes
Sidramesh_S
Moderator
Moderator
Moderator
250 sign-ins 100 replies posted 25 solutions authored

Hi @Manoj_Kumar ,

I observed that you have not updated the pins and other settings in the Device configurator as you did in the Hello World Example.

Can you please look into it and update it properly.

Thanks and regards,
Sidramesh

Can you please c

0 Likes

Sidramesh,

Thanks for response.

I believe for DFU we need only USB Pins.

For Emulated EEPROM we don't need any pins.

Can you please give me bit details on which pins I need to update?

Can you even give me bit more details on what settings has to be changed in Device Configurator?

It will be of great help as I am delayed on the project.

0 Likes

hello @Sidramesh_S ,

Can you please tell which pins to be configured and what are related settings to be done for it to work?

Or you can share a demo project which we can refer!!

 

0 Likes
Rohan136
Moderator
Moderator
Moderator
100 replies posted 25 solutions authored 10 likes received

Hi @Manoj_Kumar ,

We're working on your issue.

Can you clarify us how are you verifying EEPROM Data in blinky application. Can you also clarify what do you mean by "it does not work" in  your statement "In the CM4 Blinky code ,I read few bytes from EEPROM and later check ,if the content matches the pattern I have written. If not then I try to write the content. It does not work."  Does it mean content in not matching in EEPROM after writing?

Can you also share logs with us to assist you better?

Thanks & Regards,

Rohan

0 Likes

My use case is simple:

New device is clean slate(Nothing is written on Emulated EEPROM). Now we have a bootloader that is flashed on to the board. Our CM4 App then reads the Emulated EEPROM (if Nothing is written means the device has just come from factory). We then write some coefficients on to the Emulated EEPROM. 

This whole thing only works if we don't have bootloader and its a standalone app.

If we make it an bootloader and then in application try to write to Emulated EEPROM it does not write(All the values of Emulated EEPROM is 0), not we get any error.

Questions for you,

Did you use the bootloader? 

Are you able to create a CM4 App( which is run from bootloader as app1 ) can read and write from  Emulated EEPROM? If you have done this please share that project with us.

 

Answering your questions:

We write to EEPROM  on first boot and then read that in subsequent boot, But the values are 0.

I believe with bootloader and app writing is an issue. Reading seems fine.

I hope this clarifies the whole scenario . Let me know if you have any more questions.

0 Likes
lock attach
Attachments are accessible only for community members.
riccardo-monty
Level 3
Level 3
50 sign-ins 10 replies posted First like received

see project attached for solution.

turn out that eeprom memory can't be assigned to both cores (in dual core application), so if you use modified  the linker scripts it works.

this info can be found at following:

https://www.infineon.com/dgdl/Infineon-AN215656_PSoC_6_MCU_Dual-CPU_System_Design-ApplicationNotes-v... 

and also in other community discussion that bring to:

https://community.infineon.com/Knowledge-Base-Articles/Manage-Working-Flash-Space-for-Both-Cores-of-... 

the issue I noticed is related to following:

https://community.infineon.com/PSoC-6/PSoC6-Bootloader-Upgradeable-BLE-Stack-and-Emulated-EEPROM-EEP... 

0 Likes

Hi Riccardo,

Thanks for response,

Do you mean in the project I shared you just commented the following line in "bsps\TARGET_APP_CY8CPROTO-062-4343W\COMPONENT_CM0P\TOOLCHAIN_GCC_ARM\dfu_cm0p_app0.ld"  and it worked for you ?

Is there any other changes I could see that you are using "TARGET_APP_CY8CPROTO-062-4343W" BSP ?

My Bsp is "TARGET_APP_CY8CKIT-062S2-43012" and if i compare the project and this BSP I don't see any changes.

/* Emulated EEPROM flash area */
/*
.cy_em_eeprom :
{
KEEP(*(.cy_em_eeprom))
} > em_eeprom
*/

0 Likes

yes, with that change the firmware doesn't stuck on IPC loop.

that is the only relevant change. I unchcked debug_uart pins to use them for "retarget_io" lib and no more.

any other changes in ram assignement were previous useless tried

0 Likes
Rohan136
Moderator
Moderator
Moderator
100 replies posted 25 solutions authored 10 likes received

Hi Manoj,

I've been able to simulate your issue and we're working with the product team to address it.  I'll get back to you as soon as we have an update on this. 

Thank you for your patience in advance.

Regards,

Rohan

 

0 Likes
lock attach
Attachments are accessible only for community members.
Rohan136
Moderator
Moderator
Moderator
100 replies posted 25 solutions authored 10 likes received

Hi @Manoj_Kumar ,

 

We discovered 2 issues in the project.

1. The CM0 core was not calling bsp init and interrupt enable after finishing bootloading of the new image. As a result CM0p core is not fully initialized and cannot run requests from CM4 to write to flash.

2. The allocated address for RAM is same for CM0p and CM4. 

Here are the fixes made in main.c of CM0p and dfu_cm4_app1.ld in CM4. After this changes the eeprom works fine.

 

Regards,

Rohan

0 Likes