Other Parts Discussed in Thread: SYSBIOS
Tool/software: Code Composer Studio
Hi,
I am new with code composer, sitara and TI-RTOS. In order to learn how to configure the so and sitara peripherials I want to create a basic program to write a message throw my ICE v2 AM335x UART.
I took the SYS/BIOS minimal example as starting piont of my project. Project configuration in ccs6:
From the very begining I had loads of problems to add peripherial drivers to the project. Eventhough I included the header files mentioned in the RTOS guide I was unable to compile due to 'undefined reference to Board_init' error.
Since there is no so many information about TI-RTOS and sitara configuration it took me some time to figure out I had to add references to the drivers in the .cfg file. Not only to the ones mentioned in the guide (board and UART), but also to OSAL and CSL packages. I found this by reading post!! No workshop or guide mention this!!
After loading those packages I still having problems to compile because of some I2C and UART 'undefined references', at some point they got solved. To be honest I am not sure how... Could be the order I add the packages to the .cfg file??
Afer reading this post I added suport to MMU and cache memory.
So now mi .cfg file looks like this:
/* ================ Cache and MMU configuration ================ */
var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');
Cache.enableCache = true;
var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');
Mmu.enableMMU = true;
/* Force peripheral section to be NON cacheable strongly-ordered memory */
var peripheralAttrs = {
type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor
tex: 0,
bufferable : false, // bufferable
cacheable : false, // cacheable
shareable : false, // shareable
noexecute : true, // not executable
};
/* Define the base address of the 1 Meg page the peripheral resides in. */
var peripheralBaseAddr = 0x44e00400;
/* Configure the corresponding MMU page descriptor accordingly */
Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
peripheralBaseAddr,
peripheralAttrs);
/* Define the base address of the 1 Meg page the peripheral resides in. */
var peripheralBaseAddr = 0x481a6000;
/* Configure the corresponding MMU page descriptor accordingly */
Mmu.setFirstLevelDescMeta(peripheralBaseAddr,
peripheralBaseAddr,
peripheralAttrs);
**** Build of configuration Debug for project PDK_Drivers_Test_ICEv2AM3359 ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../app.cfg'
'Invoking: XDCtools'
"C:/ti/xdctools_3_32_01_22_core/xs" --xdcpath="C:/ti/bios_6_46_04_53/packages;C:/ti/pdk_am335x_1_0_6/packages;C:/ti/uia_2_20_00_02/packages;C:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A8F -p ti.platforms.evmAM3359 -r release -c "C:/ti/gcc-arm-none-eabi-4_9-2015q3" "../app.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring app.xa8fg from package/cfg/app_pa8fg.cfg ...
generating custom ti.sysbios library makefile ...
Linking with library ti.board:./lib/icev2AM335x/a8/release/ti.board.aa8fg
Linking with library ti.drv.gpio:./lib/a8/release/ti.drv.gpio.profiling.aa8fg
Linking with library ti.drv.i2c:./lib/am335x/a8/release/ti.drv.i2c.aa8fg
Linking with library ti.drv.uart:./lib/am335x/a8/release/ti.drv.uart.aa8fg
Linking with library ti.csl:./lib/am335x/a8/release/ti.csl.aa8fg
Linking with library ti.osal:./lib/tirtos/a8/release/ti.osal.aa8fg
Starting build of library sources ...
making C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios/sysbios.aa8fg ...
gmake[1]: Entering directory `C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm_gnu.asm ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Cache_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Mmu_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/TimestampProvider_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/timers/dmtimer/Timer_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/intcps/Hwi_asm_gnu.sv7A ...
asma8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/exc/Exception_asm_gnu.asm ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/BIOS.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/IntrinsicsSupport.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/TaskSupport.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Clock.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Idle.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Intrinsics.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Queue.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Semaphore.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Swi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Swi_andn.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/knl/Task.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Cache.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/Mmu.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/TimestampProvider.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Cache.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Core.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/CoreNull.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Hwi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Hwi_stack.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/hal/Hwi_startup.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/timers/dmtimer/Timer.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/ti81xx/TimerSupport.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/gates/GateHwi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/gates/GateMutex.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/a8/intcps/Hwi.c ...
cla8fg C:/ti/bios_6_46_04_53/packages/ti/sysbios/family/arm/exc/Exception.c ...
ara8fg arm_IntrinsicsSupport_asm_gnu.o arm_TaskSupport_asm_gnu.o a8_Cache_asm_gnu.o a8_Mmu_asm_gnu.o a8_TimestampProvider_asm_gnu.o dmtimer_Timer_asm_gnu.o intcps_Hwi_asm_gnu.o exc_Exception_asm_gnu.o _BIOS.o arm_IntrinsicsSupport.o arm_TaskSupport.o knl_Clock.o knl_Idle.o knl_Intrinsics.o knl_Queue.o knl_Semaphore.o knl_Swi.o knl_Swi_andn.o knl_Task.o a8_Cache.o a8_Mmu.o a8_TimestampProvider.o hal_Cache.o hal_Core.o hal_CoreNull.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o dmtimer_Timer.o ti81xx_TimerSupport.o gates_GateHwi.o gates_GateMutex.o intcps_Hwi.o exc_Exception.o ...
gmake[1]: Leaving directory `C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
Build of libraries done.
cla8fg package/cfg/app_pa8fg.c ...
'Finished building: ../app.cfg'
' '
1 archivo(s) copiado(s).
making ../src/sysbios/sysbios.aa8fg ...
gmake[1]: Entering directory 'C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
gmake[1]: Nothing to be done for 'all'.
gmake[1]: Leaving directory 'C:/ti/blink_ICE_test/PDK_Drivers_Test_ICEv2AM3359/src/sysbios'
'Building file: ../main.c'
'Invoking: GNU Compiler'
"C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -Dicev2AM335x -DSOC_AM335x -DBUILDCFG_MOD_UART -I"C:/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include" -I"C:/ti/pdk_am335x_1_0_6/packages" -g -gdwarf-3 -gstrict-dwarf -Wall -MMD -MP -MF"main.d" -MT"main.o" -o"main.o" @"configPkg/compiler.opt" "../main.c"
'Finished building: ../main.c'
' '
'Building target: PDK_Drivers_Test_ICEv2AM3359.out'
'Invoking: GNU Linker'
"C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -mcpu=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard -mfpu=neon -Dam3359 -Dicev2AM335x -DSOC_AM335x -DBUILDCFG_MOD_UART -g -gdwarf-3 -gstrict-dwarf -Wall -Wl,-Map,"PDK_Drivers_Test_ICEv2AM3359.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_46_04_53/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/fpu" -Wl,--defsym,STACKSIZE=0x1C000 -Wl,--defsym,HEAPSIZE=0x400 -o"PDK_Drivers_Test_ICEv2AM3359.out" "./main.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lgcc -lm -lnosys -lc -Wl,--end-group
'Finished building target: PDK_Drivers_Test_ICEv2AM3359.out'
' '
**** Build Finished ****
This is the ROV report when I run the program in my board:
,emaphoreP_tirtos.c", line 131: error {id:0x10000, args:[0x800157a4, 0x800157a4]}
xdc.runtime.Error.raise: terminating execution
Any idea of what is happening???