Author Topic: Upgrading new firmware by retaining existing data in PDS  (Read 605 times)

0 Members and 1 Guest are viewing this topic.

Offline Swati ChikmathTopic starter

  • Newbie
  • Posts: 6
  • Country: in
Upgrading new firmware by retaining existing data in PDS
« on: February 11, 2022, 03:06:27 am »
Hello Everyone,

I am trying to upgrade the new firmware by retaining existing data in PDS, Atmel Bitcloud, ATSAMR21G18A Microcontroller.

I have shifted PDS at the bottom of flash (last 32KB is the PDS section in 256KB flash).

As a first step I am flashing the complete code to flash with PDS data, then with new firmware I have truncated file to 224KB (256-32) excluding PDS then flashing the code. So that new firmware take data (like network configuration, Application Configuration, Commissioning information)from existing PDS and connects to same network and work in normal way.

But this way is not working as expected, the control of code is going to APL_taskHandler.

Please suggests how to proceed further any suggestions would be more helpful.

Thanks In advance
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11712
  • Country: us
    • Personal site
Re: Upgrading new firmware by retaining existing data in PDS
« Reply #1 on: February 11, 2022, 03:23:29 am »
The code always goes into APL_TaskHandler(). This is the main entry point for the application. Does it actually lose commissioning data? And if so, PDS is open source, you can debug it and check why it does not like the structure you have there.
Alex
 

Offline Swati ChikmathTopic starter

  • Newbie
  • Posts: 6
  • Country: in
Re: Upgrading new firmware by retaining existing data in PDS
« Reply #2 on: February 11, 2022, 07:19:02 am »
Sorry the control is not going to APL_TaskHandler()

PDS section is at the bottom, new firmware is truncated so that old firmware PDS section is not modified. Read back of PDS section from flash of old and new firmware is same. So data in PDS section is not lost.

New firmware has an extra debug_print line and because of that every function in text section is shifted by 8 bytes, but this shifting is not overlapping with PDS and D_nv section which starts from 0X38000.

But is see D_nv section data is been modified. 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11712
  • Country: us
    • Personal site
Re: Upgrading new firmware by retaining existing data in PDS
« Reply #3 on: February 11, 2022, 07:25:53 am »
I have no idea what is going on. You need to debug it and see what is going on.

Also, when checking updates, updating to the same exact firmware is a good idea.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf