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/TMDSEVM437X: GPIO Example Project undefined USE_BIOS

Genius 5840 points
Part Number: TMDSEVM437X

Tool/software: TI-RTOS

Hello,

I would like to GPIO_LedBlink in processor SDK not using TI-RTOS.

So I created and imported GPIO_LedBlink project to CCS.

Moving USE_BIOS to Undefine symbols in properties, and executed build. 

Then, following error is displayed.

Description Resource Path Location Type
gmake: *** [all] Error 2 GPIO_LedBlink_evmAM437x_armTestProject C/C++ Problem
gmake[1]: *** [GPIO_LedBlink_evmAM437x_armTestProject.out] Error 1 GPIO_LedBlink_evmAM437x_armTestProject C/C++ Problem
recipe for target 'all' failed makefile /GPIO_LedBlink_evmAM437x_armTestProject/Debug line 146 C/C++ Problem
recipe for target 'GPIO_LedBlink_evmAM437x_armTestProject.out' failed makefile /GPIO_LedBlink_evmAM437x_armTestProject/Debug line 150 C/C++ Problem

I attached text file described contents of console.

4331.console.txt
"C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O 
 
Building file: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/am437x/armv7/bios/am437x_app_evmam437x.cfg"
Invoking: XDCtools
"C:/ti/xdctools_3_50_08_24_core/xs" --xdcpath="C:/ti/pdk_am437x_1_0_13/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/ndk_3_40_01_01/packages;C:/ti/uia_2_30_01_02/packages;C:/ti/bios_6_73_01_01/packages;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A9F -p ti.platforms.evmAM437X -r debug -c "C:/ti/gcc-arm-none-eabi-6-2017-q1-update" "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/am437x/armv7/bios/am437x_app_evmam437x.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring am437x_app_evmam437x.xa9fg from package/cfg/am437x_app_evmam437x_pa9fg.cfg ...
generating custom ti.sysbios library makefile ... 
	Linking with library ti.drv.gpio:./lib/a9/release/ti.drv.gpio.profiling.aa9fg
	Linking with library ti.utils.profiling:./lib/a9/release/ti.utils.profiling.aa9fg
	Linking with library ti.board:./lib/evmAM437x/a9/release/ti.board.aa9fg
	Linking with library ti.drv.i2c:./lib/am437x/a9/release/ti.drv.i2c.aa9fg
	Linking with library ti.drv.uart:./lib/a9/release/ti.drv.uart.aa9fg
	Linking with library ti.csl:./lib/am437x/a9/release/ti.csl.aa9fg
	Linking with library ti.osal:./lib/tirtos/a9/release/ti.osal.aa9fg
Starting build of library sources ...
making C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/am437x/armv7/bios/src/sysbios/sysbios.aa9fg ...
gmake[1]: Entering directory `C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/am437x/armv7/bios/src/sysbios'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/am437x/armv7/bios/src/sysbios'
Build of libraries done.
cla9fg package/cfg/am437x_app_evmam437x_pa9fg.c ...
Finished building: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/am437x/armv7/bios/am437x_app_evmam437x.cfg"
 
Building file: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/am437x/GPIO_evmAM437x_board.c"
Invoking: GNU Compiler
"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a9 -march=armv7-a -mtune=cortex-a9 -marm -mfloat-abi=hard -Dam4379 -DSOC_AM437x -DevmAM437x -UUSE_BIOS -I"C:/CCS_v8/AM437x_demo_20190226/GPIO_LedBlink_evmAM437x_armTestProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio" -I"C:/ti/pdk_am437x_1_0_13/packages" -I"/packages" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"GPIO_evmAM437x_board.d" -MT"GPIO_evmAM437x_board.o"  @"configPkg/compiler.opt" -o"GPIO_evmAM437x_board.o" "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/am437x/GPIO_evmAM437x_board.c"
Finished building: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/am437x/GPIO_evmAM437x_board.c"
 
Building file: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/GPIO_log.c"
Invoking: GNU Compiler
"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a9 -march=armv7-a -mtune=cortex-a9 -marm -mfloat-abi=hard -Dam4379 -DSOC_AM437x -DevmAM437x -UUSE_BIOS -I"C:/CCS_v8/AM437x_demo_20190226/GPIO_LedBlink_evmAM437x_armTestProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio" -I"C:/ti/pdk_am437x_1_0_13/packages" -I"/packages" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"GPIO_log.d" -MT"GPIO_log.o"  @"configPkg/compiler.opt" -o"GPIO_log.o" "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/GPIO_log.c"
Finished building: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/GPIO_log.c"
 
Building file: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/soc/am437x/GPIO_soc.c"
Invoking: GNU Compiler
"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a9 -march=armv7-a -mtune=cortex-a9 -marm -mfloat-abi=hard -Dam4379 -DSOC_AM437x -DevmAM437x -UUSE_BIOS -I"C:/CCS_v8/AM437x_demo_20190226/GPIO_LedBlink_evmAM437x_armTestProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio" -I"C:/ti/pdk_am437x_1_0_13/packages" -I"/packages" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"GPIO_soc.d" -MT"GPIO_soc.o"  @"configPkg/compiler.opt" -o"GPIO_soc.o" "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/soc/am437x/GPIO_soc.c"
Finished building: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/soc/am437x/GPIO_soc.c"
 
Building file: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/uart/soc/am437x/UART_soc.c"
Invoking: GNU Compiler
"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a9 -march=armv7-a -mtune=cortex-a9 -marm -mfloat-abi=hard -Dam4379 -DSOC_AM437x -DevmAM437x -UUSE_BIOS -I"C:/CCS_v8/AM437x_demo_20190226/GPIO_LedBlink_evmAM437x_armTestProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio" -I"C:/ti/pdk_am437x_1_0_13/packages" -I"/packages" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"UART_soc.d" -MT"UART_soc.o"  @"configPkg/compiler.opt" -o"UART_soc.o" "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/uart/soc/am437x/UART_soc.c"
Finished building: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/uart/soc/am437x/UART_soc.c"
 
Building file: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/main_led_blink.c"
Invoking: GNU Compiler
"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a9 -march=armv7-a -mtune=cortex-a9 -marm -mfloat-abi=hard -Dam4379 -DSOC_AM437x -DevmAM437x -UUSE_BIOS -I"C:/CCS_v8/AM437x_demo_20190226/GPIO_LedBlink_evmAM437x_armTestProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio" -I"C:/ti/pdk_am437x_1_0_13/packages" -I"/packages" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -finstrument-functions -MMD -MP -MMD -MP -MF"main_led_blink.d" -MT"main_led_blink.o"  @"configPkg/compiler.opt" -o"main_led_blink.o" "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/main_led_blink.c"
Finished building: "C:/ti/pdk_am437x_1_0_13/packages/ti/drv/gpio/test/led_blink/src/main_led_blink.c"
 
Building target: "GPIO_LedBlink_evmAM437x_armTestProject.out"
Invoking: GNU Linker
"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a9 -marm -Dam4379 -DSOC_AM437x -DevmAM437x -UUSE_BIOS -Og -g -gdwarf-3 -gstrict-dwarf -Wall -finstrument-functions -MMD -MP -mfloat-abi=hard -Wl,-Map,"GPIO_LedBlink_evmAM437x_armTestProject.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_73_01_01/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard" -Wl,--defsym,STACKSIZE=0x18000 -Wl,--defsym,HEAPSIZE=0x400 --specs=nano.specs -o"GPIO_LedBlink_evmAM437x_armTestProject.out" "./GPIO_evmAM437x_board.o" "./GPIO_log.o" "./GPIO_soc.o" "./UART_soc.o" "./main_led_blink.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lrdimon -lgcc -lm -lnosys -lc -Wl,--end-group 
makefile:150: recipe for target 'GPIO_LedBlink_evmAM437x_armTestProject.out' failed
C:\CCS_v8\AM437x_demo_20190226\GPIO_LedBlink_evmAM437x_armTestProject\Debug\configPkg\package\cfg\am437x_app_evmam437x_pa9fg.oa9fg:(.data.ti_sysbios_knl_Task_Object__table__V+0x28): undefined reference to `gpio_test'
collect2.exe: error: ld returned 1 exit status
makefile:146: recipe for target 'all' failed
gmake[1]: *** [GPIO_LedBlink_evmAM437x_armTestProject.out] Error 1
gmake: *** [all] Error 2

Could you tell me how to solve these error?

Regards,

U-SK

  • U-SK,

    The build failure is caused because there is Task statically created in the .cfg file with the name gpio_test which gets commented when you undefine USE_BIOS. the name of the function become main(). If you notice the test project provided along with the GPIO LLD is linked to a .cfg and project settings is setup for XDC tools and GCC which indicates that the project is setup for RTOS. This project can`t be used as is for bare-metal setup.  I would recommend the customer to use GPIO example from diagnostics

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_board.html#diagnostics 

    The diagnostic bar-metal example uses makefile for compilation and not CCS. There is currently no readily available CCS project for GPIO LLD in bare-metal mode. The only example is based on makefile.  If CCS compilation is required then the customer will need to create a CCS project from scratch starting with simple hello world and then replace the main.c with source files form GPIO LLD example and apply the build options carefully including undefine USE_BIOS.

    1. Generate basic hello world using 

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_examples_demos.html#id48

    2. Remove main.c and .lds file and add source files from GPIO LLD RTOS example except the .cfg. Add linker command file from pdk_am43xx_1_0_13\packages\ti\board\diag\common\AM437x

    3. Copy all the GCC compiler and linker options and undefine USE_BIOS. Ensure remove unused sections and group libraries for backward references

    4. For linking you need to link board, gpio, spi, i2c, uart , csl and csl init libraries  as explained in screenshot here:

    http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index_faq.html#device-drivers 

    Also note, all the drivers provided by TI call into an OS abstraction layer. We provide two versions of the OSAL layer. One for bare-metal and the other one for RTOS so they would need to link into the nonos version for bare-metal setup as described below:

    Also, for linking libraries from PDK to bare-metal code in CCS, you need to use the technique described here:

    Regards,

    Rahul

  • Hi Rahul,

    Thank you for your reply.
    I understand.

    Regards,
    U-SK