OTA Fixed Stack Sample Code Issues

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.
MikeAustin
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

OK, so I'm trying to learn how to implement OTA in my code.  It's sloooow progress, but I'm at least moving forward.

I've played around with the BLE_OTA_FixedStack_Bootloader and BLE_OTA_FixedStack_Bootloadable example programs, and can get them to work as expected.

Next step was to write a very simple LED blinking program that I can then (hopefully) update the blink rate via OTA.  This is where I've come unstuck.  I'm clearly missing something fundamental here, but for the life of me I can't see it!

I took the relevant .c and .h files from the BLE_OTA_FixedStack_Bootloadable example project and shoe-horned those into my LED_Blinker project as per the relevant instructions.

Attached is a bundle of my workspace with the off-the-shelf BLE_OTA_FixedStack_Bootloader project, along with my LED_Blinker project all contained in the same workspace.  Note that I've not modified the BLE component from the example project at all, and I'm not actually using it in my LED_Blinker project, so have just left this as is even though I'm not using the services that are set up in the BLE component (trying not to complicate my life any more than I have to at this point)

For whatever reason, I'm getting compile errors with the sections of code that make calls to some of the functions in the ota_mandatory.c file, event those have been declared in the ota_mandatory.h file, and I've included this in my main.h header.  These compile errors are associated with calls to ConfigureSharedPins() and BootloaderSwitch(), both functions that I need to allow me to put the hardware into Bootloader mode so I can upload a new version of my LED_Blinker code OTA.

Can anyone see what I'm doing wrong here?

Cheers,

Mike

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

I am able to build your project after making some changes. I think you are missing some of the steps mentioned in out application note. The changes that I made are as below.

  1. Created a new folder "LinkerScripts" inside "LED Blinker.cydsn" folder.
  2. Moved the files cm0gcc.ld,  cm0iar.icf and cm0mdk.scat to the new folder "LinkerScripts".
  3. Double clicked on "mk.bat" file inside "OTA_Bootloader.cydsn\Scripts" folder. This step will create a new file named "BootloaderSymbolsGcc.ld" inside "LED Blinker.cydsn\LinkerScripts" folder.
  4. Added below settings to the build settings of "LED Blinker" project.
    1. Additional Library Directories : .\LinkerScripts
    2. Custom Linker Script: .\LinkerScripts\cm0gcc.ld

These steps are mentioned in our application note. Steps 8 - 16, Step 22 under the section "5.3 Adding a Fixed Stack OTA Bootloader".

I am attaching the updated projects with this response. Please test them and let me know the results.

Thanks and Regards,

Sudheesh

View solution in original post

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

Hello,

Please follow all of the steps mentioned in section "5.3 Adding a Fixed Stack OTA Bootloader" of the following application note to add a fixed stack OTA bootloader to your application, https://www.cypress.com/file/198301/download .

Thanks and Regards,

Sudheesh

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

Yeah, I did all of that. Followed it to the letter, although I didn’t copy across the debug, The issue is that I am getting compile errors as a result of my code seemingly not being able to access the relevant API’s for controlling the Bootloader LEDS and the SW2 switch.

I’ve got those declared as per the example, which compiles successfully, so I can’t see what I’m doing wrong

These are the compile errors I’m getting:

Can someone just have a go at compiling my code that I attached and see if they get the same result? And then perhaps have a look as to why this is occurring?

Cheers,

Mike

0 Likes
lock attach
Attachments are accessible only for community members.
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

I am able to build your project after making some changes. I think you are missing some of the steps mentioned in out application note. The changes that I made are as below.

  1. Created a new folder "LinkerScripts" inside "LED Blinker.cydsn" folder.
  2. Moved the files cm0gcc.ld,  cm0iar.icf and cm0mdk.scat to the new folder "LinkerScripts".
  3. Double clicked on "mk.bat" file inside "OTA_Bootloader.cydsn\Scripts" folder. This step will create a new file named "BootloaderSymbolsGcc.ld" inside "LED Blinker.cydsn\LinkerScripts" folder.
  4. Added below settings to the build settings of "LED Blinker" project.
    1. Additional Library Directories : .\LinkerScripts
    2. Custom Linker Script: .\LinkerScripts\cm0gcc.ld

These steps are mentioned in our application note. Steps 8 - 16, Step 22 under the section "5.3 Adding a Fixed Stack OTA Bootloader".

I am attaching the updated projects with this response. Please test them and let me know the results.

Thanks and Regards,

Sudheesh

0 Likes

Hi Sudheesh,

Thanks for the updated info.  I've been able to get my code to compile now.  The issue was I was getting confused with the steps involving copying various files into the LinkerScripts folders, as there are two distinct LinkerScripts folders: one created within Windows Explorer (in step 😎 and the other created within Workspace Explorer (in Step 14).  Until I got that clear in my head, I wasn't able to get things working.

Thanks for your assistance

Cheers,

Mike

0 Likes
user_2457466
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

Hi,

If you want to use the LEDs or switches defined in the bootloader project, you will have to define them in your LED blinker project as well.

br,

Martin

0 Likes