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 Reply Children
  • Okay, so lets start again.

    I want to get Motion Sensor Demo example to get working with MPU9250 with NRF 5 Dev Board.

    I imported the project from IOSsonata library. 

    Now. 

    What Need to be change in mot_sensor_demo.cpp and board.h to get this example to work with mpu9250 and get it to stream data to eclipse terminal by printf ?

    I checked the pinout of my board, and found SCL, SDA is 26,27 and I have connected it. Devboard + mpu9250 are connected and ready. 

    Doing Run. I get "Failed initializing hardware" 
    Doing Debug, I get:

  • You need to create an I2C object then pass it to the init of the MPU object.  

    Instead of 

    res = g_MotSensor.Init(s_AccelCfg, &g_Spi, &g_Timer);

    replace the g_Spi with your g_I2c object you created.

    res = g_MotSensor.Init(s_AccelCfg, &g_I2c, &g_Timer);

    See also the TPHDemo how to select between SPI & I2C to interface with the environmental sensor.

  • I did that and I can't build:

    /Users/jacobbudny/Desktop/DEVELOPMENT/IOsonata/exemples/sensor/mot_sensor_demo.cpp:254:39: error: 'g_I2c' was not declared in this scope

      254 |   res = g_MotSensor.Init(s_AccelCfg, &g_I2c, &g_Timer);

          |                                       ^~~~~

    make: *** [src/mot_sensor_demo.o] Error 1

    "make all" terminated with exit code 2. Build might be incomplete

    So in mot_sensor_demo.cpp there is no i2c communication option at all yes? I need to add it, to get it to work?

    If I use SPI to communicate with MPU9250 all of it will be simpler or not? Because really, I do not even know where to start if I would need to write i2c communication for mpu9250 for this example. 

    Maybe you can suggest any simpler way? Like I spent a week now and nothing works. 

  • Yes I am looking over right now and trying to understand:

    static const I2CCFG s_I2cCfg = {

    0, // I2C device number

    {

    {I2C0_SDA_PORT, I2C0_SDA_PIN, I2C0_SDA_PINOP, IOPINDIR_BI, IOPINRES_PULLUP, IOPINTYPE_OPENDRAIN},

    {I2C0_SCL_PORT, I2C0_SCL_PIN, I2C0_SCL_PINOP, IOPINDIR_OUTPUT, IOPINRES_PULLUP, IOPINTYPE_OPENDRAIN},

    },

    100000, // Rate

    I2CMODE_MASTER,

    5, // Retry

    0, // Number of slave addresses

    {0,}, // Slave addresses

    true, // DMA

    false, // Use interrupt

    7, // Interrupt prio

    NULL // Event callback

    };

    I2C g_I2c;


    #define TPH_I2C // To use I2C interface ---> If I change to TPH_SPI it would be using I2C yes?

    #ifdef TPH_I2C

    DeviceIntrf *g_pIntrf = &g_I2c;

    #else

    DeviceIntrf *g_pIntrf = &g_Spi;

    #endif

    That means defining I2C yes?

    SO I need to copy that and paste that to the motion_sensor_demo.cpp?
    And It should work? 



Related