PSoC4S : Flash Emulate EEPROM with Non-blocking Feature for ModusToolbox

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

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Dear Sirs and Madams,

 

We are considering EmEEPROM for PSoC4S with reference to the following sample code on Github.

 

/* Example project in Github */

https://github.com/Infineon/mtb-example-psoc4-emulated-eeprom

 

After confirming the operation of this project, it was confirmed that the operation would stop if an interrupt occurred while writing to EmEEPROM.

 

So I searched for a community site and found KBA233049, however the target development environment was PSoC Creator.

 

/* PSoC 4 Flash Emulate EEPROM with Non-blocking Feature – KBA233049 */

https://community.infineon.com/t5/Knowledge-Base-Articles/PSoC-4-Flash-Emulate-EEPROM-with-Non-block...


Is it possible for you to tell me the same procedure with ModusToolbox?

 

・Target file to modify

・Suppression of regeneration of GeneratedSource

・Mapping to .ld file

 

I think the above is different between PSoC Creator and ModusToolbox.

 

Regards,

0 Likes
6 Replies
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Hi,

Yes, the non-blocking application is different between PSoC Creator and ModusToolbox. Now we don't have the project to achieved the feature, but  I will follow up on this requirement.

 

MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

LinglinG-san,

 

Thank you for your reply.

We are having trouble with interrupts in the middle of writing to EmEEPROM(Flash).

I am familiar with PSoC Creator, but ModusToolbox is difficult to handle, so I would appreciate your support for a solution.

 

For example, while writing to EmEEPROM, do you think disable interrupts or the cretical section in PSoC Ceratror is effective?

If those countermeasures are effective, is there an API like critic section in ModusToolbox?

 

Regards,

0 Likes
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

LinglinG-san,

 

EmEEPROM_Write API was blocking code in PSoC Creator.

MaMi_1205306_0-1663636394066.png

 

in the first place, Are We correct in thinking that the middleware provided by Modus Toolbox is non blocking code?

 

/* mtb-example-psoc4-emulated-eeprom in github */

https://github.com/Infineon/mtb-example-psoc4-emulated-eeprom

 

Using this middleware, the MCU stops when an interrupt is processed while writing to the EmEEPROM.

By any chance, are ModusToolbox's EmEEPROM middleware and past PSoC Creator's EmEEPROM components significantly different?

 

Regards,

0 Likes

1:in the first place, Are We correct in thinking that the middleware provided by Modus Toolbox is non blocking code?

No, the MTB middleware is also blocking.

2: No matter the MTB or the PSoC Creator, they also call the flash write API: " Cy_Flash_WriteRow()".

If you want to achieve the non-blocking flash write, it is recommend that you can use psoc creator depending on the KBA you present in the first responding.

MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

LinglinG-san,

 

Thank you for your answer!

I understood that EmEEPROM_Write API of Modus Toolbox middleware is also blocking code.

However, if another interrupt enters while the EmEEPROM_Write API is being executed, it will behave as if the MCU has stopped.

Should interrupts be disabled to avoid this problem?

Does ModusToolbox have an API like PSoC Creator's critical section?

 

Regarsd,

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

Now, it is suggested that you can port the code from PSoC Creator to MTB.

0 Likes