This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I need help with converting any example from Keil to SES

Hello,

I've been trying for days to convert any example from Keil to SES, I have road probably every question here on the dev zone but I am unable to fix this, I ever specially install windows on my mac to try if there it would work.

So, I have done everything from official nordic documents, I've been through several problems which I happily solve, but that I'm not able to.

I get those errors:


unplaced section: .log_dynamic_data_app [nrf_log_frontend.o], size=12, align=4

undefined symbol: __SRAM_segment_end__

undefined symbol: __start_log_const_data

undefined symbol: __start_log_dynamic_data

undefined symbol: __stop_log_const_data

I'm working on latest SEGGER, I have tried latest SDK, also 14.2 . The same errors. 

Thanks for reply

Parents
  • It seems like you are not using the correct startup code.  Startup code and linker scripts are different.  Startup code and linker script go in pair. You need to use the one made for SES.

  • Hey, I have followed instructions from here https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/segger-embedded-studio-a-cross-platform-ide but its a little bit outdated since now there is SES 4.50.

    Maybe there is a tutorial of how to rewrite programs from Keil to SES? Please like, I have spent so much hours for that, everyone seems get it done, and I am unable to transfer even Blinky example... 

  • oh no. You need to use the nrfjprog to flash the softdevice first. the hex file of the softdevice is in the SDK under components/softdevice/...

  • Okay, so I need to flash it twice yes?

    Firstly I did:

    " cd /Users/jacobbudny/Desktop/DEVELOPMENT/external/nRF5_SDK/components/softdevice/s132/hex "
    // to get to the folder where soft device is

    " nrfjprog --family NRF52 --program s132_nrf52_7.0.1_softdevice.hex --verify "
    // then that fo flash the softdevice

    I got that:                                      

    Parsing hex file.

    ERROR: The file specified could not be found.

    jacobbudny@Philips-MBP hex % nrfjprog --family NRF52 --program s132_nrf52_7.0.1_softdevice.hex --verify                                     

    Parsing hex file.

    Reading flash area to program to guarantee it is erased.

    Checking that the area to write is not protected.

    Programming device.

    Verifying programming.

    Verified OK.

    -----------
    // So I assume its okay?

    Than I flashed the BlueIOThingy
    " cd /Users/jacobbudny/Desktop/DEVELOPMENT/IOsonata/ARM/Nordic/nRF52/nRF52832/exemples/BlueIOThingy/Eclipse/Debug "
    // to get to the folder

    "nrfjprog --family NRF52 --program BlueIOThingy.hex --verify "

    Parsing hex file.

    Reading flash area to program to guarantee it is erased.

    Checking that the area to write is not protected.

    Programming device.

    Verifying programming.

    Verified OK.


    // And I did a reset on the board,  so I assumed it should be okay? but it still do not advertise ;/ don't know what I am doing wrong


                 





  • Ok now I see what you are doing.  To use nrfjprog to flash BlueIOThingy.hex, you need first use mergehex to merge both hex files into one.  then use nrfprog to flash.  It cannot be flashed in 2 passes.

    Other option is to use debug config in Eclipse to launch BlueIOThingy.  To use that you only need to use nrfjprog to flash softdevice only.  Then Eclipse will take care of the BlueIOThingy.  In this mode, you only need to flash softdevice once. Unless it got erase by other firmware such as Blinky (non ble).

  • Okay so I Did what you have recommend:

    I merged softdevice as recommended here:
    https://devzone.nordicsemi.com/f/nordic-q-a/16088/merge-hex-files

    So I did that:

    mergehex -m BLE.hex s132.hex -o comb.hex // to merge hex files 

    Parsing input hex files.

    Merging files.

    Storing merged file.

    nrfjprog --eraseall // to erase all 

    Erasing user available code and UICR flash areas.

    Applying system reset.

    nrfjprog --family NRF52 --program comb.hex --verify // to flash

    Parsing hex file.

    Reading flash area to program to guarantee it is erased.

    Checking that the area to write is not protected.

    Programming device.

    Verifying programming.

    Verified OK.

    nrfjprog --reset // to reset 

    Applying system reset.

    Run.


    And still I didn't make it to advertise, I assume for sure its not a problem with example, so I don't know what else I should do. I would try to debug the example to see what's wrong, but I don't know how to solve that I did not see JLINK option in my eclipse preferences -> debug/run ->



  • Did you compile Debug build ? The debug build needs to run within the debugger.  Compile the Release build instead.

Reply Children
  • I did that:

    1. in Eclipse, Project -> Build configurations -> set active -> 1 Debug 
    than Project -> Build All

    and I have outcome: 

    Build Finished. 0 errors, 2 warnings. (took 3s.169ms)

    2.  in Eclipse, Project -> Build configurations -> set active -> 2 Release
    than Project -> Build All

    and I have outcome: 

    Build Finished. 0 errors, 0 warnings. (took 81ms)

    Firstly I merged BlueIOThingy.hex file from Debug folder (in BlueIOThingy example project) it it of course do not worked.


    Now I merged BlueIOThingy.hex file from Realese folder (in BlueIOThingy example project) and still I am not able to see it advertise but I see a change, On dev Board: LED2, LED3, LED4 is on and LED1 is blinking very very quickly. I do not know if it means something, but this is the difference from now and before. 

    Is the debug need to be run with JLINK option in Eclipse ->Preferences->Run/Debug->JLINK ? Because if Yes maybe that is the problem? Cause it is not there, I don't know why. 

  • To run from Eclipse debugger, first select the project BlueIOThingy.  Then select from the menu "Run/Debug Configurations...".  You'll see a popup.  From the left you see a list of selections.  look for JLink.  Create a new configuration.    You see 

    Browse and select your BlueIOThingy.elf you want to use. Then select Debugger tab

    Set NRF52832_XXAA in the device name box.  Then click debug.  It will flash and start debugging mode.

    The BlueIOThingy firmware is made for this board.

    It's available at https://www.crowdsupply.com/i-syst/blyst-nano

    To use it on a different board. You need to modify the code for your own board.  The current board uses the BME680 and the ICM-20948 sensors.

  • I got this from debug session:

    assertion "s" failed: file "/Users/jacobbudny/Desktop/DEVELOPMENT/external/Invn/Devices/Drivers/Icm20948/Icm20948Serif.h", line 78, function: inv_icm20948_serif_read_reg


    Okay so maybe I did not understand from the begining..

    To be fully cleared:

    What I have:
    nrf52 DK this one: https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF52-DK
    MPU9250 this one: https://www.sparkfun.com/products/13762

    What I want:
    I want to connect MPU9250 (GND,VDD,SCL,SDA) (or another 9axis sensor, I can also get another sensor if its necessary, if with ICM-20948 its simpler or better that's not problem for me.) to nrf52 DK and get raw data from MPU9250 (accx,accy etc.(9 of those)) over bluetooth to computer/phone/tablet and receive them in real time. And I've been fighting with it for a month now.

    Where should I start? Or If its even possible?

    As you said in your first answer:
    "Example source code using MPU-9250 and stream data to Thing App.

    https://github.com/IOsonata/IOsonata/tree/master/ARM/Nordic/exemples/BlueIOThingy "

    I was convinced that its possible? But now I am not exactly sure ;/ Where should I start then?




    Thanks anyway for your help, you've been so helpful, can't thank you enough...


  • The driver is available for both.  All you need to do is to use the correct driver with the correct interface.  Which means to configure I2C driver with your pin map.  Then pass it to the MPU-9250 driver.  it is at line 602 of BlueIOThingy.cpp.  The default is SPI interface.  Pass your I2C interface to it. The I2C configuration is at line 250-274

    Change line 602 from

        if (MPU9250Init(&g_Spi, &g_Timer) == true)

    to

        if (MPU9250Init(&g_I2c, &g_Timer) == true)

    and in board.h change pin map for the MPU9250 interrupt pin of your board.  The code related to the MPU is in BlueIOMPU9250.cpp

    The firmware auto detect the MPU-9250 or the ICM-20948.

    At the same time you can change the I/O map for the LED to your board as well.

  • Okay I changed the lines, 

    But I do not see any I2C/TWI pins here to set up to nordic dv board:

    //#define NORDIC_DK // For Nordic DevKit

    #ifdef NORDIC_DK

    #define UART_TX_PIN 9//7

    #define UART_RX_PIN 11//8

    #define UART_RTS_PIN 8//11

    #define UART_CTS_PIN 10//12

    #define SPI_DEVNO            2

    #define SPI_MISO_PORT        0

    #define SPI_MISO_PIN         13

    #define SPI_MISO_PINOP       1

    #define SPI_MOSI_PORT        0

    #define SPI_MOSI_PIN         12

    #define SPI_MOSI_PINOP       1

    #define SPI_SCK_PORT         0

    #define SPI_SCK_PIN          11

    #define SPI_SCK_PINOP        1

    #define SPI_BME280_CS_PORT         0

    #define SPI_BME280_CS_PIN          26

    #define SPI_BME280_CS_PINOP        1

    #else

    "
    I only see SPI pins here. I can't figure it out what pins is for SCL/SDA, Or maybe I should redefined them?



    Also in lines 250-274 in BlueIOThingy.cpp there is nothing about mpu9250, only for air/humidity sensors  and their connection.

    I searched more about mou9250 in code, but I am able to figure out what else to change to get the raw data from it over ble.

    Also, I still did not managed to get nordic dev kit to advertise with this example, maybe there is more to change ?

Related