porting nRF52 project from IAR to ARMGCC

Hi. I have a working IAR project based on the nrf52 SDK \nordic\examples\ble_peripheral\ble_app_uart. i am attempting to port the project to ARMGCC using VSCode. I am at a stage in the port where all the files compile and link and I am at the main() stepping in and out of functions using the GDB. i come across a function "localtime" and have a HARDFAULT. I verified the input parameters are valid.

thanks in advance.

Barry

Parents
  • You don't specify what version of the library you are using. Also, this stuff gets deep rather quickly and difficult to file without every configuration. 
    Is it possible to single step INTO the function? 

    My quick guess is that something inside the function went from a heap/stack type variable to a flash variable and something is trying to write to it. I saw something like this happen between 2.7.0 and 2.91 - there was a nice little macro that made a variable for me, but someone added a "const" to it inside the SDK and my code wrote to this generated variable. CRASH
    A M 

  • hello 

    i debugged my code in IAR when reaching the statement:  struct tm *t = localtime(&hitless_ptr()->rtc_var.m_time), I looked for the declaration of localtime and IAR took me to C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.3\arm\inc\c, file time32.h. In ARMGCC, compilation and linking go without error or warning, but while debugging in GDB and stepping over localtime, I get the hardfault.

    Thanks in advance.

Reply
  • hello 

    i debugged my code in IAR when reaching the statement:  struct tm *t = localtime(&hitless_ptr()->rtc_var.m_time), I looked for the declaration of localtime and IAR took me to C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.3\arm\inc\c, file time32.h. In ARMGCC, compilation and linking go without error or warning, but while debugging in GDB and stepping over localtime, I get the hardfault.

    Thanks in advance.

Children
Related