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
  • well just do step over the function and if the function return false then restart to that function and step into it to find out why.  You don't have to step all the way neither.  Just set a breakpoint where you suspect a problem and run upto it

  • Okay so I found out that this function make res = false:

    res = g_Imu.Init(s_ImuCfg, &g_MotSensor, &g_MotSensor, &g_MotSensor); change res from true to false, so I step into it:

    First:


    than I step into: bool res = vpMpu->InitDMP(DMP_START_ADDR, (uint8_t*)s_DMPImage, DMP_CODE_SIZE);





    here's the change, this function change bool res = false;  then I step into res = UploadDMPImage(pDmpImage, Len); hoping that later if(res) change res to true;
    then here is that:

    and lots of minor steps, but getting there:


    And I am not able to get out of "while" couple of times, than lots of minor steps, and then here:


    and then everything breaks and "failed initializing hardware"

    Reassuminng

    So this function results false:

    res = g_Imu.Init(s_ImuCfg, &g_MotSensor, &g_MotSensor, &g_MotSensor); -> results false,


    inside that function, this function results false:
     bool res = vpMpu->InitDMP(DMP_START_ADDR, (uint8_t*)s_DMPImage, DMP_CODE_SIZE);


    inside that function, this function makes res false and later [
    if (res)] makes it again true
    bool AgmMpu9250::InitDMP(uint32_t DmpStartAddr, uint8_t * const pDmpImage, int Len)
    {
    	bool res = false;
    	uint8_t regaddr;
    	uint8_t d[2];
    //	uint8_t intval;
    
    	if (pDmpImage == NULL || Len == 0)
    		return false;
    
    	// load external image
    	res = UploadDMPImage(pDmpImage, Len);
    
    	if (res)
    	{
    		vbDmpEnabled = true;
    
    		d[0] = DmpStartAddr >> 8;//DMP_START_ADDR >> 8;
    		d[1] = DmpStartAddr & 0xFF;//DMP_START_ADDR & 0xFF;
    
    		// Write DMP program start address
    		regaddr = MPU9250_DMP_PROG_START;
    		Write(&regaddr, 1, d, 2);
    
    		// Undocumented : Enable DMP
    		regaddr = MPU9250_AG_USER_CTRL;
    		d[0] = Read8(&regaddr, 1) | MPU9250_AG_USER_CTRL_DMP_EN;
    		Write8(&regaddr, 1, d[0]);
    
    		// DMP require fifo
    		EnableFifo();
    
    		res = true;
    	}
    
    	return res;
    }

    but we step into:
    res = UploadDMPImage(pDmpImage, Len);


    then there is a lot of steps, but basically we get into:

    while (len > 0)
    	{
    		int l = min(len, MPU9250_DMP_MEM_PAGE_SIZE);
    
    		regaddr = MPU9250_DMP_MEM_BANKSEL;
    		d[0] = memaddr >> 8;
    		d[1] = memaddr & 0xFF;
    
    		Write(&regaddr, 1, d, 2);
    
    		regaddr = MPU9250_DMP_MEM_RW;
    		Write(&regaddr, 1, p, l);
    
    		p += l;
    		memaddr += l;
    		len -= l;
    	}

    then we do step into:
    Write(&regaddr, 1, d, 2);

    and we by stepping into few times get this:

    #ifdef NRF52_SERIES
    	while (DataLen > 0)
    	{
    		int l = min(DataLen, NRF52_I2C_DMA_MAXCNT);
    
    		dev->pReg->EVENTS_ERROR = 0;
    		dev->pReg->EVENTS_STOPPED = 0;
    	    if (dev->pI2cDev->DevIntrf.bDma)
    	    {
    			dev->pDmaReg->TXD.PTR = (uint32_t)pData;
    			dev->pDmaReg->TXD.MAXCNT = l;
    			dev->pDmaReg->TXD.LIST = 0;
    	    }
    		dev->pReg->SHORTS = (TWIM_SHORTS_LASTTX_SUSPEND_Enabled << TWIM_SHORTS_LASTTX_SUSPEND_Pos);
    		dev->pReg->EVENTS_SUSPENDED = 0;
    		dev->pReg->TASKS_RESUME = 1;
    		dev->pReg->TASKS_STARTTX = 1;
    
    		if (nRF5xI2CWaitTxComplete(dev, 100000) == false)
                break;
    
    		DataLen -= l;
    		pData += l;
    		cnt += l;
    	}
    #endif

    where:
    if (nRF5xI2CWaitTxComplete(dev, 100000) == false)
                break;


    and doing step into breaks the code and "failed initializing hardware",

    But while doing "step over" we step over this:
    Write(&regaddr, 1, d, 2);

     and we can't get over this loop, I do step over step over, and nothing, to break this loop I need to do step return.
    while (len > 0)
    	{
    		int l = min(len, MPU9250_DMP_MEM_PAGE_SIZE);
    
    		regaddr = MPU9250_DMP_MEM_BANKSEL;
    		d[0] = memaddr >> 8;
    		d[1] = memaddr & 0xFF;
    
    		Write(&regaddr, 1, d, 2);
    
    		regaddr = MPU9250_DMP_MEM_RW;
    		Write(&regaddr, 1, p, l);
    
    		p += l;
    		memaddr += l;
    		len -= l;
    	}


    When I do step return I get back over here:
    bool AgmMpu9250::InitDMP(uint32_t DmpStartAddr, uint8_t * const pDmpImage, int Len)
    {
    	bool res = false;
    	uint8_t regaddr;
    	uint8_t d[2];
    //	uint8_t intval;
    
    	if (pDmpImage == NULL || Len == 0)
    		return false;
    
    	// load external image
    	res = UploadDMPImage(pDmpImage, Len);
    
    	if (res)
    	{
    		vbDmpEnabled = true;
    
    		d[0] = DmpStartAddr >> 8;//DMP_START_ADDR >> 8;
    		d[1] = DmpStartAddr & 0xFF;//DMP_START_ADDR & 0xFF;
    
    		// Write DMP program start address
    		regaddr = MPU9250_DMP_PROG_START;
    		Write(&regaddr, 1, d, 2);
    
    		// Undocumented : Enable DMP
    		regaddr = MPU9250_AG_USER_CTRL;
    		d[0] = Read8(&regaddr, 1) | MPU9250_AG_USER_CTRL_DMP_EN;
    		Write8(&regaddr, 1, d[0]);
    
    		// DMP require fifo
    		EnableFifo();
    
    		res = true;
    	}
    
    	return res;
    }

    and minor step into this:

    vbDmpEnabled = true;

    is looping again this:
    while (len > 0)
    	{
    		int l = min(len, MPU9250_DMP_MEM_PAGE_SIZE);
    
    		regaddr = MPU9250_DMP_MEM_BANKSEL;
    		d[0] = memaddr >> 8;
    		d[1] = memaddr & 0xFF;
    
    		Write(&regaddr, 1, d, 2);
    
    		regaddr = MPU9250_DMP_MEM_RW;
    		Write(&regaddr, 1, p, l);
    
    		p += l;
    		memaddr += l;
    		len -= l;
    	}





    So I assume problem is somewhere there, but I am to newbie to understand anything from this. 


     

  • It is unable to upload the DMP firmware.  That is only for special algorithm.  The actual sensor don't need. You can comment out the imu.  The sensor part should work.

  • As just told you.  Comment out that imu init line. you don't need it.

Related