Psoc 4 BLE: ERROR, Region Ram overflowed with stack

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

cross mob
JaOr_4642046
Level 3
Level 3
First like received

Hi all,

I am trying to implement a bootloader which connecting with a external memory by SPI, for that I use (as reference) the document " Psoc 4 BLE - OTA Firmware Upgrade using Serial NOR flash".  As it is shown in the screenshot at the moment I start the SPI the message is "ERROR: Ram overflowed with stack"

Any idea about it?

pastedImage_0.png

the result is

pastedImage_1.png

when in dis-comment this line :  ( I put this line (EMI_SPIM_Start()) to easy shown the behaviour)

pastedImage_2.png

pastedImage_3.png

The TopDesign is :

pastedImage_4.png

Thanks very much in advance for your help, I hope some of you have any idea about it.

Regards.

0 Likes
1 Solution

Hello,

As I mentioned in my previous response, it is not recommended modify the external memory bootloader project to add additional functionalities. Bootloader project uses functions in BLE component related to data encryption and decryption. That is why BLE component is present in bootloader project.

Is it necessary to use an external SPI memory for bootloading in your application? If not, you can try to use fixed stack OTA bootloader or upgradable stack OTA bootloader in your application. Both of these will support programming bootloader first and later sending application from host. Please find more details about them from our application note: https://www.cypress.com/file/198301/download .

Thanks and Regards,

Sudheesh

View solution in original post

0 Likes
30 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

To get a better understanding about this issue, could you please share your bootloader project with us? Are you using any of our code examples or writing your own bootloader project?

An example for SPI based external memory bootloader project is available at: PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader at master · cypresssemiconductor... .

Thanks and Regards,

Sudheesh

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

Hi Sudheesh

Many thanks for your answer.

I have used exactly the example code which you have indicate. to get a roughly idea about SPI and external memory in boot-loader.

The weird thing to me is just with add the line  "EMI_SPIM_Start();" it give to me de message even I did not use this module.

Anyway, I attached the Bootloader project. I hope it could give you an idea of why this happen and  you can guide me about it.

Thank you very much.

Have a nice day.

Regards

0 Likes

Hi

I forgot to mention I have been playing around with Stack Size and Heap Size but without positive results

pastedImage_0.png

Regards

0 Likes

Hi Sudheesh,

I realised I have this configuration on the BLE component (image below)

pastedImage_3.png

On the example which you have

: PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader at master · cypresssemiconductor... .

The BLE configuration is:

pastedImage_4.png

when I swap this blocks ( BLE from your example by  "CyBle" of my project) the overflowed error is gone (of course appear others), but I can´t leave it like that, since my project is communicate with the external device by the configuration "HID over GATT" and in this sense it is already works.

I tried to remove services like "bootloader", but If I remove "bootloader" service, I lose API which I need on the code.

pastedImage_7.png

Honestly, I am not sure which way I need to follow to sorted this issue.

I appreciate any suggest

Regards

0 Likes

Hello,

I am able to build your project without any errors (Call to function EMI_SPIM_Start(); function is not commented). Are there any other steps to be followed to recreate this failure?

The error you observe "ERROR: region RAM overflowed with stack" happens when more memory is allocated for stack and heap in .cydwr file -> System tab. As per your previous response, I understand that you tried different stack and heap size for your project. Did you try reducing the stack and heap size from default value?

In the bootloader project, it is not required initialize the SPI block separately. The function Bootloader_Start(); will automatically initialize it. Could you please clarify why you are calling the function "EMI_SPIM_Start();" form main?

Thanks and Regards,

Sudheesh

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

Hi Sudheesh,

Before anything, I wish to say that appreciate your help about it a lot.

I am able to build your project without any errors (Call to function EMI_SPIM_Start(); function is not commented). Are there any other steps to be followed to recreate this failure?

I attach the folder again , I not sure, may be the previous folder, which I uploaded, it could be have modifications ( my tries) and I didn't realize before send you (in this case sorry).

This "new" folder is cleans, the only steps I follow are:

          1º) In the "original" project (my develop project)  TopSesing.cysch has implemented the blocks  "Cyble" and "Bootloader", (and everything is working OK).

          2º) I add "EMI_SPIM" and "EMI_SPIM_SlaveSelect" pin (from the Cypress example mentioned, with the same configuration)

          3º) I clean an build the project.

          4º) I add   " EMI_SPIM_Start();" in line 104 of "main.c" (just to check if it give me the overflowed message )

and the failure appear.

The error you observe "ERROR: region RAM overflowed with stack" happens when more memory is allocated for stack and heap in .cydwr file -> System tab. As per your previous response, I understand that you tried different stack and heap size for your project. Did you try reducing the stack and heap size from default value?

pastedImage_5.png

Since the failure is because of small memory size, I just increased it, honestly, I did not try to reduce it. it is no sense to me but I will try it and let see,  if this is the problem and anything change, I will post here to everyone.

(note: in the above image,  A) they was the original values)  the values modifications did not fix the issue.

In the bootloader project, it is not required initialize the SPI block separately. The function Bootloader_Start(); will automatically initialize it. Could you please clarify why you are calling the function "EMI_SPIM_Start();" form main?

I am Sorry, I don't exactly understand your question.

I just try to follow the PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader/BLE_External_Memory_Bootloader01/ example.

In this example from:

               main().c ->Bootloader_Start(),

               go to

               Bootloader.c->Bootloader_Start() ->Bootloader_HostLink() ->CyBtldrCommStart()

               go to

               CustomInterafce.c -> EMI_Start();

               go to

               ExternalMemoryInterface.c -> EMI_SPIM_Start();

In my case, when I tried to do something similar to this, was when it also shown me the failure,  so by simplicity I captured the picture with the call functions "...START()"  in the main().c  ( previous check that if I call the function from main() the failure was the same )

I hope it can help and I have explained myself properly.

Thanks and Regards,

0 Likes

Hello

As per my understanding, your requirements are as below. Please correct me, if I am wrong.

1. Need to use "Human Interface Device", "Device Information", Battery Service", "Scan parameters" and bootloader services in your application.

2. User external memory (SPI) bootloader to update application over the air.

To implement the above requirements, you should use the external memory bootloader example project from Cypress without any changes and implement the required BLE services in the bootloadable project. Please refer our example projects available at: https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Project051.... As you can see in this example projects, BLE component in bootloader project has only 2 services "Generic Access" and Generic Attribute". Other services "Device Information", "Bootloader" and "Heart Rate" are implemented in Bootloadable project.

Were you able to test the bootloader and bootloadable projects available from above link successfully? Please check if you can perform bootloading operation to update application. If it is working without any issues, then you can modify the bootloadable project as per your requirements. It is not recommended to modify the bootloader project.

Thanks and Regards,

Sudheesh

0 Likes

Hello,

As always thanks for your help.

Yes, you are right, I got an interface BLE using  "human Interface Device" and so in my application, and I need to use a external memory (SPI) boot-loader to update application over the air, But from the own Boot-loader.

I am quite new using Cypress components so some of concepts, at the moment, escape to my knowledge. So I don´t know if it possible to do or not what I am going to explain.

**********************************************************************************************

From the example project which you referenced, I can see two parts:

1) boot-loadable: we have (among others):

          a) BLE: this one have services, which are used to communicate with the Host (e.g mobile ) when the application is running in a normal working stage (internal memory) as mechanism to exchange information each other.

          b) SPI: This SPI master is used, in this normal working stage, to send the data received from host to the external flash memory.

on the other hand we got

2) boot-loader: we have (among others):

          a) BLE:  it has just two mandatory services.

          b) SPI:  it is in charge of going to external flash memory and charge the image, which previously was received from host,  to the internal flash.

*************************************************************************************************

If I do not wrong in the above short summary.  I got some questions:

          a ) On 2.a) ¿what exactly is the functionality doing this BLE with this two services on boot-loader?, could I modify this one with another services? ( y presume yes),What kind of implications does it have respect to the BLE block in boot-loadable area?

          b)  As I mentioned above, I wondering if it possible to get the BLE connection between host (= mobile) and  Server (= device) when the boot-loader started, then send  the data received from host to the external flash and if everything are OK, charge this data to the internal flash, all of this process implemented  from  Boot-loader not from boot-loadable.

In summary, I can´t use the boot-loadable for communicate with the flash, for load and unload, and I wonder if I could do that from Boot-loader.

Thank you very much.

0 Likes

Hello,

As I mentioned in my previous response, it is not recommended modify the external memory bootloader project to add additional functionalities. Bootloader project uses functions in BLE component related to data encryption and decryption. That is why BLE component is present in bootloader project.

Is it necessary to use an external SPI memory for bootloading in your application? If not, you can try to use fixed stack OTA bootloader or upgradable stack OTA bootloader in your application. Both of these will support programming bootloader first and later sending application from host. Please find more details about them from our application note: https://www.cypress.com/file/198301/download .

Thanks and Regards,

Sudheesh

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

Hello Sudheesh,

Sadly I need to use the external SPI memory.  The Psoc 4 BLE we are using is at 96% of its capacity and also we want to be sure that the upgrade it OK  before delete the old internal memory application.

The problem is that we are using 2 UART  for serial communication with other MCU and with the outside, and apparently this is the maximum number of serial blocks which are allowed at Psoc 4 BLE. that  is one of the reason I was wondering if was possible to add the SPI just in the boot-loader project?

*********************************

On the other hand, I am trying to do your suggest, I downloaded the "PSoC 4 BLE - OTA Firmware Upgrade using Serial NOR Flash ", I have upgraded the Psoc 4 BLE with this app and change the pins to match with my, I don´t use the UART so I disabled it. But although the projects seem OK, when I try to upgrade the new "boot-loadable" this is the result.

pastedImage_0.png

could you orientate me about why could happen this disconnect?

Also I attach the log, in case it can help.

PS: On the device I am using :  CYBLE-212020-01  and Flash: S25FL064LABMF1013

Many Thanks.

0 Likes

Hello,

Can you please set the ECO capacitance trim values as explained in following knowledge base article and test again?

KBA: ECO Capacitance Trim Values for EZ-BLE™ Modules - KBA218990

Is it possible for you to enable UART? If yes, please give us the UART log also.

Thanks and Regards,

Sudheesh

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

Hello Sudheesh

A)

I was stuck all this weekend. So I am now a bit more happy thanks to this suggest, it is doesn't works completely but we have take one step forward (Thanks)

As you can see below, I added the command at line "72" on the "main().c" file of the Cypress examples. ( I could not found the plase which suggest in :

ECO Capacitance Trim Values for EZ-BLE™ Modules - KBA218990​ )

=> "For setting ECO capacitance trim value in firmware, add the following code in the CYBLE_EVT_STACK_ON event:"

pastedImage_0.png

Below you can see the result.

pastedImage_1.png

As you can see, the error is now in the transfer Firmware image. Which is a bit peculiar since the image which I send through OTA (at the moment) is exactly the same image which I programming with the programmer.

Any idea?

I tried a second time and the result was the same, this time it sent some data through OTA, I attach the message

pastedImage_2.png

I attach the log too.

*****************************************************************************************************************************************************

*****************************************************************************************************************************************************

B)

In regard to the uart:

I tried too to run this. since I am working with our own PCB, I have tried to connect the UART to my PC using the "Sdata" pin connector of the programmer ( ping 24 of BLE chip). As I slow below.

pastedImage_3.png

With this configuration I have tried to see the data using Putty at 115200 but the result is just rubbish ( I changed the baud rate with the same result). But I am not sure if this is the correct way to visualize the UART messages using the programmer (which, on the other hand, is the only access I have from my pc to the PCB)

pastedImage_4.png

If I doing something wrong I am more than happy to read you suggest about it and sent to you the UART log.

Thank you very much.

Regards.

0 Likes

Hello,

I found the issue mentioned above post (I leave it here in case it can help to another people) . The issue came from a external signal which was affecting to the SPI bus therefore this produced a Checksum error.

Now the example, PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader at master · cypresssemiconductor...   is working. The Dongle send the image to the external memory.

Thanks.

***********************************************************************************************************

***********************************************************************************************************

Now cypress´  example is working properly, I am still wondering:

from this example, it is possible to run the functionality  which collecting image and send it to external memory but in the boot-loader project?

I will try to explain myself with the next images.

1) I got the Boot-loadable running until SW2 is press. In this moment, the stack pointer jump to 2)

pastedImage_78.png

in 2) ( which is programming in boot-loader) I am trying to do exactly as the original example do, send image from dongle to external flash memory. and when this transfer have finish, 3) run the boot-loader (as original example) .

pastedImage_80.png

Is it possible to do that in the boot-loader project? I mean,  is it possible to call a function from boot-loadable to boot-loader previous reset the system and after execute this image transfer (Dongle to external flash)  reset the system and launch the boot-loader (external flash to internal flash) ?

Thank you very much and Regards.

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

Hello,

As I mentioned in my previous responses, it is not recommended to modify the bootloader project. Adding BLE stack will take more than 30% of the internal flash, but you are already using 96% of the flash.

Another way is to use an unconfigured SCB block and configure it as UART during normal operation and as SPI master during bootloading. But, the UART pins and SPI pins need to be shared. As per my understanding, you are already using 2 SCB blocks in your application for UART communication. If you can use this method, then you can configure one of the SCB blocks as unconfigured and configure it as UART or SPI master during run time. You can refer PSoC creator SCB component datasheet for more information about configuring SCB block during runtime.

Please see the attached project. I modified our bootloader and bootloadable projects to implement this method. Changes made to the example projects are as below.

  1. Configured SCB block "EMI_SPIM" as "Unconfigured SCB".
  2. Unconfigured SCB blocks need an input clock. So, added clock component "EMI_SPIM_CLK" and set it to HFCLK (32MHz).
  3. Added additional source files to configure SCB block as UART and SPI master. (spi_config.c, spi_config.h, uart_config.c, uart_config.h). They are present under the folder "SCB_Config".
  4. This project will configure "EMI_SPIM" SCB block as UART from main(). Please see the function "config_SCB_UART()".
  5. When the bootloader service is activated, it will reconfigure "EMI_SPIM" block as SPI master. See function config_SCB_SPI().
  6. After configuring as SPI master, code will try to read device ID from flash device. This is just for debugging purpose. Reading correct device ID will confirm that the SPI block got reconfigured as SPI master. Device ID for S25FL064L device is "0x01, 0x60 and 0x17". It is mentioned in the datasheet of flash device.
  7. Now, you can try to bootload from CySmart application.

I did not change the name of the SCB block (EMI_SPIM) to avoid updating the API names in the file "ExternalMemoryInterface.c" file. If it is working at your side, you can modify the names as per your application. Please test the attached project and let me know the result.

Thanks and Regards,

Sudheesh

0 Likes

Hi Sudheesh,

It seems like a possible good solution !!!! Thanks
I have two UART in the boot-loadable file, and one of this UART have pins connected to an external memory and another MCU, so if I can use (As you mentioned) this Technic. I can use this SCB at the boot-loader time as SPI so in this way I could download the image from external flash memory to internal memory and after that change this SCB to UART so it could communicate with the other MCU in normal running. ¿ Am I right? it is the idea, is not it?.

******************************************************************************************************

I had a problem when I tried to use the attached files.

I downloaded the attached folder and when I tried to run it this was the result.

pastedImage_0.png

After that I created a workspace from scratch and added the two project "BLE_External_Memory_Bootloadable01.cydsn" and "BLE_External_Memory_Bootloader01.cydsn", Update component and "clean and build all projects"  and this was the result.

pastedImage_6.png

As you can see in the above image, apart of the errors 1), not appear the pins information in 2). (probably because of the errors in 1)). I am not sure. It is quite weird without having touched anything, that it why I ask you before try anything else.

do you have any idea what could happen this?.

Thank you very much for your support,

Regards

0 Likes

Hi

I found a "solution" for the issue mentioned on the previous post.

I started with the original project (PSoC-4-BLE/100_Projects_in_100_Days/Project051_NOR_Flash_Bootloader at master · cypresssemiconductor... ). After check everything is OK,, I copied the folders "topDesign", .C and .h which are in the attached files of previous post and seems that with this steps it builds and compile the project without errors.

Thanks

0 Likes

Hello,

I have not seen the error that you mentioned in your response before. I downloaded the project that I attached in my last response and tried to build it. I am not observing any errors. I am using PSoC Creator 4.3, which version of PSoC Creator are you using? If it is an earlier version, can you install version 4.3 and try to open the projects again? Latest version of PSoC Creator is available at: https://www.cypress.com/products/psoc-creator-integrated-design-environment-ide .

As per your latest response, you are able to build the project now. Did you try to perform bootloading from CySmart with the new project (Using one SCB block as UART and SPI)? Are you observing any issues?

Thanks and Regards,

Sudheesh

0 Likes

Hello Sudheesh, thousand of thanks.

The PSoC creator version which I use is 4.3. But after I read your post I downloaded the example again and I run it  from "...\MCU\Cypress_Psoc\BLE_External_Memory_Bootloader01.Bundle01.Bundle01"

(before, I ran it from ("...\MCU\Cypress_Psoc\WorkSpace_BLE_OTA\BLE_External_Memory_Bootloader_using_nor_flash\SPI_UART_RUN_TIME_CONFIGURATION\BLE_External_Memory_Bootloader01.Bundle01.Bundle01" and didn´t work)

I not sure, but seems it doesn't likes too long path​.

Now everything is OK, compiler and run without error. I have been able to see the output messages and the transmission using CySmart and the Dongle is working too.

PS: if you don´t mind, could you let me know from where did you call the function config_SCB_SPI()? please, I couldn´t  found it in the code.

Thank you very much for your support.

Best Regards.

JV

0 Likes

Hello,

I am happy to hear that the project is working now.

The function "config_SCB_SPI()" is called from "EMI_Start()" function in "ExternalMemoryInterface.c" file. "EMI_Start()" function is called from "BootloaderEmulator_Start()" function before calling "BootloaderEmulator_HostLink()" in the file "BootloaderEmulator.c". You can use the shortcut "CTRL+Shift+F" to search a keyword in a project or workspace.

Thanks and Regards,

Sudheesh

0 Likes

Hello,

Thanks for your suggest, I used to use the shortcut "CTRL+F" the one which you suggest it is much more useful.

******************************************************************************

In relation to the project:

I could see the message ("Configured SCB \"EMI_SPIM\" as UART") in console (I got an external pin for a "sw tx UART" block which is used for debug)

but not the messages (which is used to check the correct functioning of "Unconfigured block") :

               "SCB Configured as UART"

               "This SCB will be re-configured as SPI master when bootloader service is activated"

since I have not external connection to this pins to debug it.

I have the next configuration:

     A ) At the beginning

  B ) After

pastedImage_14.png

With above configuration A), the system is working, but when I change the UART block for a unconfigured block ( mode SPI/UART) and setting this as UART B),  the system doesn't works.

Any suggest?,  the baud rate of two blocks are the same ( 115200), 8 bits, one stop bit.... but doesn't  works.

I tried to use a Unconfigure block on the other MCU  (instead of UART), just to check if the issue came by any kind different configuration, but the PSoC-5 doesn't have this kind of block. So I don't know if I need to modify another parameter of unconfigured block, I read the document "PSoC 4 Serial Communication Block (SCB)" and I didn't find anything about it.

PS: I checked the MCU pin with the oscilloscope and I could see data coming out with both configurations

Below you can see the general idea I would like to do.

pastedImage_0.png

Thanks and Regards.

0 Likes

Hello,

I would like to know some more details about this issue. Please provide below information.

  1. How do you test and confirm that configuration B is not working? Are you printing the UART messages received by PSoC5 device?
  2. Are you modifying the project that I sent to you? Or, are you modifying your own project by changing an SCB UART block as unconfigured SCB? If you are modifying your project, Make sure you configure SCB as UART before using it to send and receive data.
    1. What is the HFCLK frequency used? You can find it from the "Clocks" tab under the section "Design wide resources" in PSoC creator project.
    2. Are you able to configure the unconfigured SCB as SPI master and access the flash device? Did you observe any issues with SPI communication also?

    Thanks and Regards,

    Sudheesh

    0 Likes

    Hello

    I found a solution to the above asked

    I changed the value of EMI_SPIM_CLK from 32Mhz to 48Mhz also I changed

    pastedImage_1.png

    Which I do not understand well is:

    my general system is running from a 48Mhz clock but when we connect a 32Mhz clock on the input of "Unconfigured block" and set the "UART_CLK_DIVIDER" to 16, I assumed that "doesn´t mattered" with clock was connect to the input since the baud rate was calculated in function of:

                             CLOCK (input of block) + UART_CLK_DIVIDER + UART_OVERSAMPLING.

    but apparently it is not like that. am I right? so, is it necessary to match the main clock system with the input clock block? this doesn't make sense to me but....

    Thanks and regads

    0 Likes

    Hello,

    Yes, it is necessary to match the main clock with the input clock block.

    You have to change the UART_CLK_DIVIDER value when you change the main clock frequency. You should set the frequency of input clock block equal to HFCLK and set the clock divider (UART_CLK_DIVIDER) value based on the required baud rate.

    Thanks and Regards,

    Sudheesh

    0 Likes

    Hi and thank you for your clarification.

    ****************************************************************************************

    I am sorry , if you don´t mind I have another question in relation at the same subject.

    From the cypress example  SPI to external memory (we already talk about it in this thread), we have something similar which is shown in the image below.

    pastedImage_0.png

    My questions are:

         a) if I have just one boot-loadable Application (as shown in 1)), the application image which is recorded in external flash,  is it like is show in 1)?, I mean, the image and metadata are recorded separated.

        b) the boot-loadable Application start to recorded in external flash from position 0, If I need to start in the position 04000 (for example) where could I change this in boot-loader and boot-loadable files ?

        c) Last question, If I want to do something like 2),  record two different images  to external memory and use one of this depending of a "x" condition .

                   c.1) which part I need to modify in the boot-loadable (spi) to indicate the image a) is going to start in.... and the image b) is going to start in.....?

                   c.2)  and, which part I need to modify in the boot-loader (spi) to indicate that I wish to read image a) in the position .....  or  image b)  in the position.... ?

    Thanks and regards.

    0 Likes

    Hello,

    Please see the below macros defined in "ExternalMemoryInterface.h" file of both Bootloader and Bootloadable projects.

    /*******************************************************************************

    * External Memory Layout

    *******************************************************************************/

    /* First sector of 4 kB to store metadata only (128 bytes); rest is blank.

    * This is done so that metadata can be erased independently of the application.

    */

    #define EMI_MD_BASE_ADDR                                (0x000000u)

    /* Second sector onwards data is stored, each row size is 256 bytes but the

    * data stored per row is only 128 bytes, so as to make things simple.

    */

    #define EMI_APP_BASE_ADDR                                (EMI_MD_BASE_ADDR + EMI_EXTERNAL_MEMORY_SECTOR_SIZE)

    /* Address calculation for app pages - each page size in the external memory

    * is 256 Bytes, but the actual row size for BLE chips could be 128/256 bytes,

    * so both can be accomodated. In case of 128 byte BLE chips, the first 128

    * bytes in the external memory's page are filled, and the remaining are empty.

    */

    #define EMI_APP_ABS_ADDR(row)                         (EMI_APP_BASE_ADDR + ((row) * EMI_EXTERNAL_MEMORY_PAGE_SIZE))

    You can change the value of the macro EMI_MD_BASE_ADDR (in both bootloader and bootloadable projects) to change the location at which the application is stored on the external flash. By changing the base address, you will be able to store application at different locations of external flash, but you won't be able to switch between different applications during run time as bootloader always read data from the same location on the external flash memory.

    Thanks and Regards,

    Sudheesh

    0 Likes

    Hi Sudheesh,

    I already found this part of code and as you can see on the post, when I modified this code a couple of question became to me.

    Many thanks.

    Best regards.

    0 Likes

    Hello,

    I am not clear about your latest requirement about storing two application images on external flash memory. As I mentioned in my previous response you can edit the values of the macros EMI_MD_BASE_ADDR and EMI_APP_BASE_ADDR to store application images at different locations. But, you won't be able to switch between the applications stored in external memory during run time as bootloader always read data from the same location on the external flash memory. How are you planning to use the application images stored in external flash memory? Please provide more details about your requirement.

    Thanks and Regards,

    Sudheesh

    0 Likes

    Hello Sudheesh,

    I will try to explain myself,

    pastedImage_14.png

    As you can see in the above picture, I have two MCU, (Psoc 4 and Psoc 5), These two are sharing an external memory, at the same time each MCU have his own bootloader.the idea is:

    1) when a new update is ready for PSoc 4, BLE copies the new image for BLE in position (a), after that it starts the bootloader 1 and copy the image from external memory to internal memory and reboots the MCU (PSoc 4).

    2)  when a new update is ready for PSoc 5, BLE copies the new image for  Psoc 5 in position (b), after that it starts the bootloader 2 and  the image is copy from external memory to internal memory of PSoc 5 and it reboots the MCU (PSoc 5).

    With this solution, I think in case any issue are detected I could implement an auto charge again for reboot the system with the external memory images.

    NOTE: My idea is start, using the same memory position for both. (first use for BLE and when everything are ok, use the same position of memory for PSoC 5) but if I can, I would like to implement the above described option. To do that I need to indicate to bootloader 1 starts in position (a) and bootloader 2 starts in position (b). And I need to know how to manage the metadata too.

    As always many thanks for your support, I appreciate it a lot

    Best regards.

    0 Likes

    Hello,

    Details about metadata fields are available in the booloader component datasheet.

    Thanks and Regards,

    Sudheesh

    0 Likes

    Hi all,

    Apparently when image is record on external memory the structure is like :

    pastedImage_0.png

    In which  the firth 4 KB  are used for Metadata also just the 128 Bytes are already used, the rest is black.

    Possible Solution:

    pastedImage_1.png

    To have two images in memory in different position change the values in "External Memory Interface.h" as it is shown below.

    This change must be made in both "bootloader" and "boot-loadable" projects.

    pastedImage_13.png

    Doubts:

    a) I recorded the second image at the 0x02000 position but I think Would this happen.

    pastedImage_3.png

    Metadata #2 overwrite metadata #1 So,  Do I need to modify the value which is marked like 2) in the above image to a value different to 0x0000? In this case.

    b) The metadata #2 position is it going after to metadata #1 or it needs to go just below "Bootloadable Application #2"?  Which of the following cases would it be?

    pastedImage_0.png

    Thank you very much.

    Best regards.

    0 Likes