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... 

  • I tried clearing and changing accel freq but nothing change. I will try to debug that process and find what's could be wrong

  • Okay, the whole function 

    bool AgmMpu9250::UpdateData() 

    is nearly working.



    because "val" is equal to zero, I don't understand this function, but I assume it should update data, and it do not update it because, all of the "if's" are not working because of theirs condition?

    And val is equal zero because of that: (which is earlier in the code from screen)

    if (vbSensorEnabled[MPU9250_ACCEL_IDX] == true)
    		val += 8;
    	if (vbSensorEnabled[MPU9250_GYRO_IDX] == true)
    		val += 6;
    	//if (vbSensorEnabled[MPU9250_MAG_IDX] == true)
    	//	val += 8;

    So: vbSensorEnabled[MPU9250_ACCEL_IDX] is not true and also vbSensorEnabled[MPU_GYRO_IDX] is not true.

    Should I delete out commented bSensorEnabled[MPU9250_ACCEL_IDX] ?

    What else would you recommend to change?

    Second case is:
    also when I added here function to read magnetometer values:

    bool HardwareInit()
    {
    	bool res;
    
    	g_Timer.Init(s_TimerCfg);
    
    	res = g_I2c.Init(s_I2cCfg);
    
    	if (res == true)
    	{
    		res = g_MotSensor.Init(s_AccelCfg, &g_I2c, &g_Timer);
    		if (res == true)
    		{
    			g_pAccel = &g_MotSensor;
    		}
    
    		res = g_MotSensor.Init(s_GyroCfg, &g_I2c, &g_Timer);
    		if (res == true)
    		{
    			g_pGyro = &g_MotSensor;
    		}
    		res = g_MotSensor.Init(s_MagCfg, &g_I2c, &g_Timer);
    		if (res == true)
    		{
    			g_pMag = &g_MotSensor;
    		}
    
    		//res = g_Imu.Init(s_ImuCfg, &g_MotSensor, &g_MotSensor, &g_MotSensor);
    	}
    
    	if (res == true)
    	{
    
    		int8_t m[9] = { 1, 0, 0,
    						0, 1, 0,
    						0, 0, 1 };
    	}
    
    	return res;
    }


    this function returns false to the bool res, and while I try to debug it, I come to that:


    what ever I do, the timeout is reduced by 1 and I can't get over this loop. 

  • Awesome! Now it works,  I am getting the values for accelerometer and gyroscope. 

    But still there is problem with getting data from magnetometer:s

    res = g_MotSensor.Init(s_MagCfg, &g_I2c, &g_Timer);
    		if (res == true)
    		{
    			g_pMag = &g_MotSensor;
    		}

    this function returns false, when I try to debug that, the code is stopping here:


    Also there is a problem with converting raw data accel and gyro values,



    The gyro converted values are NaN, and the values for accel is a little bit weird, it's impossible to get that kind of low values, I was thinking about maybe I should multiple them by 10, but it will also be little bit strange. 

    and what else is strange is that I get different values when I try to run, and different if I debug
    In debug I got:
    accdata.X =-0,25
    accdata.Y=0.11
    accdata.Z=0.97

    In run in terminal I am getting:

    Data: 1073695294 -1610612736 -1076244429 

    Data: 1073703486 536870912 -1076228044 

    Data: 1073700926 1073741824 -1076221900 

    those different numbers, 

    screen presenting this:

  • I did not managed to fix it, does anybody know how to get data from magnetometer? and converting raw data to G's from acc and gyro ?

Reply Children
Related