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
  • Hi I'm back after a while. I am trying to retain some data structure in RAM in my c file, I define 

    #if defined(__ICCARM__)  // IAR Compiler
    #pragma location = HITLESS_START_ADDRESS
    __no_init volatile HITLESS_STRUCTURE hitless_struct; 
     #elif defined(__GNUC__)  // GCC Compiler
    /**
     * @brief Fixed-location hitless structure (retains values across soft reset).
     */
    __attribute__((section(".persistent")))
    __attribute__((used))
    volatile HITLESS_STRUCTURE hitless_struct;
     #else

    in my linker file I define:

    SECTIONS
    {
      . = 0x20003324;
      hitless_struct = .;
      .persistent (NOLOAD) :
      {
        KEEP(*(.persistent))
      } > RAM
    }

    When debugging, the address is set as designated; however, after a soft reset, the data is not retained.

    I appreciate any help you can provide.

    Barry

Reply
  • Hi I'm back after a while. I am trying to retain some data structure in RAM in my c file, I define 

    #if defined(__ICCARM__)  // IAR Compiler
    #pragma location = HITLESS_START_ADDRESS
    __no_init volatile HITLESS_STRUCTURE hitless_struct; 
     #elif defined(__GNUC__)  // GCC Compiler
    /**
     * @brief Fixed-location hitless structure (retains values across soft reset).
     */
    __attribute__((section(".persistent")))
    __attribute__((used))
    volatile HITLESS_STRUCTURE hitless_struct;
     #else

    in my linker file I define:

    SECTIONS
    {
      . = 0x20003324;
      hitless_struct = .;
      .persistent (NOLOAD) :
      {
        KEEP(*(.persistent))
      } > RAM
    }

    When debugging, the address is set as designated; however, after a soft reset, the data is not retained.

    I appreciate any help you can provide.

    Barry

Children
No Data
Related