This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM335X: Project build issues

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: AM3359, SYSBIOS

Tool/software: TI-RTOS

I'm back...

Let me detail my steps, so the TI support people can see the hours and hours and day and days wasted trying to make this stuff work...

Create a simple new project, in my case for BBB, as a "typical" Sys/Bios project.  Include the  symbols:  am3359,  SOC_AM335x,  bbbAM335x   and the packages EDMA and PDK.

Build it.  Okay, we're happy.  Except we can't do any board access.  So add this:

#include <ti/board/board.h>

  /* Call board init functions */
    Board_initCfg boardCfg;

    boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK ;
    Board_init(boardCfg);

No problem.  But we get this, which is expected....  

 makefile:146: recipe for target 'WillNotBuild.out' failed
./main.o: In function `main':
C:\Source\Embeded\Beagle\WillNotBuild\Debug/../main.c:39: undefined reference to `Board_init'
collect2.exe: error: ld returned 1 exit status

But what follows isn't:

Okay, so go into the CFG file, and add this:

var Board = xdc.loadPackage('ti.board');
Board.Settings.boardName = "bbbAM335x";

And now when we build it, we get this:

C:\ti\pdk_am335x_1_0_7\packages\ti\board\lib\bbbAM335x\a8\release\ti.board.aa8fg(bbbAM335x_lld_init.oa8fg): In function `Board_uartStdioInit':
bbbAM335x_lld_init.c:(.text.Board_uartStdioInit+0x10): undefined reference to `UART_stdioInit'
collect2.exe: error: ld returned 1 exit status

So, based on what I learned from my post in e2e.ti.com/.../2560250  I also add this, in the correct location

var UartPackage = xdc.loadPackage('ti.drv.uart');

And try to build it. but now we get this:

makefile:146: recipe for target 'WillNotBuild.out' failed
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_stdio.oa8fg): In function `UART_stdioInit':
UART_stdio.c:(.text.UART_stdioInit+0x50): undefined reference to `SemaphoreP_Params_init'
UART_stdio.c:(.text.UART_stdioInit+0x70): undefined reference to `SemaphoreP_create'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_drv.oa8fg): In function `UART_init':
UART_drv.c:(.text.UART_init+0x20): undefined reference to `UART_config'
UART_drv.c:(.text.UART_init+0x28): undefined reference to `UART_config'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_drv.oa8fg): In function `UART_open':
UART_drv.c:(.text.UART_open+0x4): undefined reference to `UART_config'
UART_drv.c:(.text.UART_open+0x8): undefined reference to `UART_config'
collect2.exe: error: ld returned 1 exit status
gmake[1]: *** [WillNotBuild.out] Error 1

Well, UART_Config is something that the end user needs to supply. So I added a "DummyUARTc" file that supplies the missing symbols.  But what is "SemaphoreP_Params_init"??  The Semaphore package is already present in the CFG file.

So I added these to the CFG file, again, in the correct place.

var socType			= "am335x";
var osType 			= "tirtos";

var Csl = xdc.loadPackage('ti.csl');
Csl.Settings.deviceType = socType;

// .... 

var Osal = xdc.useModule('ti.osal.Settings');
Osal.osType = osType;
Osal.socType = socType;

Now it's getting REALLY bad.  The errors are now these:

makefile:147: recipe for target 'WillNotBuild.out' failed
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_v1_callback':
UART_v1.c:(.text.UART_v1_callback+0x68): undefined reference to `SemaphoreP_post'
UART_v1.c:(.text.UART_v1_callback+0x70): undefined reference to `SemaphoreP_post'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_open_v1':
UART_v1.c:(.text.UART_open_v1+0x40): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_open_v1+0x58): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_open_v1+0x18c): undefined reference to `Osal_RegisterInterrupt_initParams'
UART_v1.c:(.text.UART_open_v1+0x1c0): undefined reference to `Osal_RegisterInterrupt'
UART_v1.c:(.text.UART_open_v1+0x1d8): undefined reference to `SemaphoreP_Params_init'
UART_v1.c:(.text.UART_open_v1+0x20c): undefined reference to `SemaphoreP_create'
UART_v1.c:(.text.UART_open_v1+0x24c): undefined reference to `SemaphoreP_create'
UART_v1.c:(.text.UART_open_v1+0x260): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_close_v1':
UART_v1.c:(.text.UART_close_v1+0x6c): undefined reference to `Osal_DeleteInterrupt'
UART_v1.c:(.text.UART_close_v1+0x8c): undefined reference to `SemaphoreP_delete'
UART_v1.c:(.text.UART_close_v1+0x98): undefined reference to `SemaphoreP_delete'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_writeCancelNoCB.isra.0':
UART_v1.c:(.text.UART_writeCancelNoCB.isra.0+0x2c): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_writeCancelNoCB.isra.0+0x60): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_writeCancelNoCB.isra.0+0x6c): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_readCancelNoCB.isra.3':
UART_v1.c:(.text.UART_readCancelNoCB.isra.3+0x20): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_readCancelNoCB.isra.3+0x54): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_readCancelNoCB.isra.3+0x70): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_charPut_v1.isra.5':
UART_v1.c:(.text.UART_charPut_v1.isra.5+0x20): undefined reference to `Osal_delay'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_readPolling_v1':
UART_v1.c:(.text.UART_readPolling_v1+0x50): undefined reference to `Osal_delay'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_read2_v1':
UART_v1.c:(.text.UART_read2_v1+0x34): undefined reference to `_DebugP_assert'
UART_v1.c:(.text.UART_read2_v1+0x5c): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_read2_v1+0x94): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_read2_v1+0x1fc): undefined reference to `SemaphoreP_pend'
UART_v1.c:(.text.UART_read2_v1+0x224): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_read_v1':
UART_v1.c:(.text.UART_read_v1+0x30): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_read_v1+0x40): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_read_v1+0x78): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_write2_v1':
UART_v1.c:(.text.UART_write2_v1+0x30): undefined reference to `_DebugP_assert'
UART_v1.c:(.text.UART_write2_v1+0x50): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_write2_v1+0x88): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_write2_v1+0x218): undefined reference to `SemaphoreP_pend'
UART_v1.c:(.text.UART_write2_v1+0x254): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_write_v1':
UART_v1.c:(.text.UART_write_v1+0x30): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_write_v1+0x40): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_write_v1+0x78): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_stdio.oa8fg): In function `UART_stdioInit':
UART_stdio.c:(.text.UART_stdioInit+0x50): undefined reference to `SemaphoreP_Params_init'
UART_stdio.c:(.text.UART_stdioInit+0x70): undefined reference to `SemaphoreP_create'
collect2.exe: error: ld returned 1 exit status

Getting really annoyed, and swearing at this eco-system, I start throwing EVERYTHING from my config file that I modified and was working based on the other post... That's mmu, profile, I2C, etc...  Try another clean/rebuild.  The results are still:

makefile:147: recipe for target 'WillNotBuild.out' failed
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_v1_callback':
UART_v1.c:(.text.UART_v1_callback+0x68): undefined reference to `SemaphoreP_post'
UART_v1.c:(.text.UART_v1_callback+0x70): undefined reference to `SemaphoreP_post'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_open_v1':
UART_v1.c:(.text.UART_open_v1+0x40): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_open_v1+0x58): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_open_v1+0x18c): undefined reference to `Osal_RegisterInterrupt_initParams'
UART_v1.c:(.text.UART_open_v1+0x1c0): undefined reference to `Osal_RegisterInterrupt'
UART_v1.c:(.text.UART_open_v1+0x1d8): undefined reference to `SemaphoreP_Params_init'
UART_v1.c:(.text.UART_open_v1+0x20c): undefined reference to `SemaphoreP_create'
UART_v1.c:(.text.UART_open_v1+0x24c): undefined reference to `SemaphoreP_create'
UART_v1.c:(.text.UART_open_v1+0x260): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_close_v1':
UART_v1.c:(.text.UART_close_v1+0x6c): undefined reference to `Osal_DeleteInterrupt'
UART_v1.c:(.text.UART_close_v1+0x8c): undefined reference to `SemaphoreP_delete'
UART_v1.c:(.text.UART_close_v1+0x98): undefined reference to `SemaphoreP_delete'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_writeCancelNoCB.isra.0':
UART_v1.c:(.text.UART_writeCancelNoCB.isra.0+0x2c): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_writeCancelNoCB.isra.0+0x60): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_writeCancelNoCB.isra.0+0x6c): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_readCancelNoCB.isra.3':
UART_v1.c:(.text.UART_readCancelNoCB.isra.3+0x20): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_readCancelNoCB.isra.3+0x54): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_readCancelNoCB.isra.3+0x70): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_read2_v1':
UART_v1.c:(.text.UART_read2_v1+0x5c): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_read2_v1+0x94): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_read2_v1+0x1fc): undefined reference to `SemaphoreP_pend'
UART_v1.c:(.text.UART_read2_v1+0x224): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_read_v1':
UART_v1.c:(.text.UART_read_v1+0x30): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_read_v1+0x40): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_read_v1+0x78): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_write2_v1':
UART_v1.c:(.text.UART_write2_v1+0x50): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_write2_v1+0x88): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_write2_v1+0x218): undefined reference to `SemaphoreP_pend'
UART_v1.c:(.text.UART_write2_v1+0x254): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_v1.oa8fg): In function `UART_write_v1':
UART_v1.c:(.text.UART_write_v1+0x30): undefined reference to `HwiP_disable'
UART_v1.c:(.text.UART_write_v1+0x40): undefined reference to `HwiP_restore'
UART_v1.c:(.text.UART_write_v1+0x78): undefined reference to `HwiP_restore'
C:\ti\pdk_am335x_1_0_7\packages\ti\drv\uart\lib\a8\release\ti.drv.uart.aa8fg(UART_stdio.oa8fg): In function `UART_stdioInit':
UART_stdio.c:(.text.UART_stdioInit+0x50): undefined reference to `SemaphoreP_Params_init'
UART_stdio.c:(.text.UART_stdioInit+0x70): undefined reference to `SemaphoreP_create'
collect2.exe: error: ld returned 1 exit status
gmake[1]: *** [WillNotBuild.out] Error 1

Really??  HWI_xxx symbols are missing??  OSAL_xxx  symbols are missing?? Even though they are listed in the CFG file?? 

This is the RAT HOLE that I've been dragged down, simply trying to add ONE SINGLE function call to an otherwise childishly simple example program.  And is why I normally throw my hands up, erase the ENTIRE project, and drag out the older version of StarterWare.  At least I can link to those without this nightmare (and I can build the libs so I can debug them too...  Not like the stuff in this PDK that won't build, and you can't pull into CCS and build debug versions - But that's another post, which also never got solved).

Here's the project.

.

WillNotBuild.zip

  • Well, I got it.  By pure RANDOM trial and error.  Plus looking at the other CFG from a working project.  This is the order needed to make it link:

    /********************************************
    	LOAD ALL DRIVERS...  IN THIS ORDER TO LINK THEM
    ***********************************************/
    
    var socType			= "am335x";
    var osType 			= "tirtos";
    
    /*use CSL package*/
    var Csl = xdc.loadPackage('ti.csl');
    Csl.Settings.deviceType = socType;
    
    var Osal = xdc.useModule('ti.osal.Settings');
    Osal.osType = osType;
    Osal.socType = socType;
    
    var UartPackage = xdc.loadPackage('ti.drv.uart');
    
    /* Load Profiling package */
    var Utils = xdc.loadPackage('ti.utils.profiling'); 
    
    var Board = xdc.loadPackage('ti.board');
    Board.Settings.boardName = "bbbAM335x";
    /**********************************************
    	END OF DRIVERS
    ***********************************************/

    However, I am not going to mark this as resolved, because it's just semi-random guessing that gave me a solution. By reducing it to 5 libraries, I am down to about 120 combinations.  Maybe half that when I "just know" that "csl" should be first.  It's "resolved" when it's understood and repeatable.

    And why, when I remove "ti.utils.profiling" do I get these missing symbols?

    .....\package\cfg\app_pa8fg.oa8fg:(.rodata.ti_sysbios_knl_Task_hooks__A+0x0): undefined reference to `TaskRegisterId'
    .....\package\cfg\app_pa8fg.oa8fg:(.rodata.ti_sysbios_knl_Task_hooks__A+0xc): undefined reference to `mySwitch'
    collect2.exe: error: ld returned 1 exit status
    

    What are these?  Where is it documented that these are required by the app cfg file, and must be resolved by the profiling module??

  • The RTOS team have been notified. They will respond here.
  • As an aside...

    You would think, since our company is buying 1000's of these units a year, we could get better help.

    But our technical sales person (Viktorija Cecil) told us to just communicate with E2E.  Since we lost some of the skilled people, we have a couple seasoned developers (me included) trying to learn this eco-system, and find it phenomenally challenging.

    TI might want to re-think that strategy, since another division in our company is developing on NXP, and appears to be making better progress.

  • Chris,

    I understand your issues as I have been helping you through many of your build issues. The basic SYSBIOS typical project only includes limited functionality. It is responsibility of the TI RTOS application developer to link in the required modules for the application. This includes modules from BIOS kernel , SOC libraries or peripheral drivers etc.

    Likely reason for your build issues is that you don`t have the following modules:

    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

    Our recommendation for TI RTOS developers using a specific SOC/processor is to start with .cfg files from a demo or from one of the peripheral driver projects and then start customizing it. We went through this process with a customer recently and they were able to use the app.cfg that we provided in the location :

    processor_sdk_rtos_am335x_4_xx_xx_xx\demos\rtos_template_app\am335x\evmAM335x\A8\template_app

    Documentation :http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_Template_App

    from an SOC development perspective, we have created a project configuration that contains all the necessary BIOS functionality and CSL, BOARD and also shown how multiple drivers can be integrated and run using multiple tasks with varying priority levels. Note the example was created for evmAM335x. From feedback that we received, we also didn`t link the board library from the .cfg and moved that to the project settings. hence when you try to build this for bbbAM335x then you would need to use :

    linkerBuildOptions=
           " -L${TI_PDK_INSTALL_DIR}/packages/ti/board/lib/bbbAM335x/a8/release/
             -l:ti.board.aa15fg

    Please use this as a starting point to build your application. 

    Regards,

    Rahul

    PS: We log all of the feedback from application developers and have been taking actions gradually to address these concerns. We are helping multiple customers in parallel to build their applications so E2E is a good model for addressing large developer community where our responses get archived and help others running into similar issues. Our goal is to reach every E2E question within 24 hours period so Viktorija`s guidance is in line with our current support model.