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/AM5746: USB Sample project for SMP mode

Guru 24520 points

Part Number: AM5746
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hi TI Experts,

Please let me confirm the following question.

[Question]
When used the "USB_DevBulk_idkAM574x_armExampleProject" and modified the code to enabled the SMP mode, but customer met the following error. It showed the following error.
********************
This module does not support SMP mode. Please use ti.sysbios.family.arm.a15.smp.Cache module instead.
********************

Would you please provide the solution to resolve this issue?

If you have any questions, please let me know.
Best regards.
Kaka

  • Hi,

    How do you modify the USB example into a SMP project? Do you change the .cfg file and can you elaborate the change? And can you provide the Processor SDK RTOS, SYSBIOS and XDC version information? Can you provide the build log?

    I thought this is SYSBIOS question but would like to get details.

    Regards, Eric

  • Hi Eric,

    They have used the v5.0.0 PSDK and added the smpEnabled=true to cfg file on sample code.

    I do not have their build log now. I will request to provide them and get back to here.
    If you have any solution to resolve this issue before attaching the log, please let me know.

    Best regards.
    Kaka

  • Hi,

    We also found the same error with PROCESSOR-SDK-RTOS-AM57X 05_01_00_11 like below;

    - C:\ti\pdk_am57xx_1_0_12\packages\MyExampleProjects\USB_DevBulk_idkAM574x_armExampleProject

    - CCS 8.1.0.00011

     

    We would like to share the pdf in detail and the build log.

     

    We would appreciate if you check the behavior.

     

    Best regards,

    **** Build of configuration Debug for project USB_DevBulk_idkAM574x_armExampleProject ****
    
    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O 
     
    Building file: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/am57xx/usb_arm_am574x_idk.cfg"
    Invoking: XDCtools
    "C:/ti/xdctools_3_50_07_20_core/xs" --xdcpath="C:/ti/bios_6_73_00_12/packages;C:/ti/pdk_am57xx_1_0_12/packages;C:/ti/edma3_lld_2_12_05_30B/packages;C:/ti/ipc_3_50_02_02/packages;C:/ti/ndk_3_40_01_01/packages;C:/ti/uia_2_30_01_02/packages;" xdc.tools.configuro -o configPkg -t gnu.targets.arm.A15F -p ti.platforms.idkAM572X -r debug -b "C:/ti/pdk_am57xx_1_0_12/packages/ti/build/am574x/config_am574x_a15.bld" -c "C:/ti/gcc-arm-none-eabi-6-2017-q1-update" -DBOARD=idkAM574x "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/am57xx/usb_arm_am574x_idk.cfg"
    configuring usb_arm_am574x_idk.xa15fg from package/cfg/usb_arm_am574x_idk_pa15fg.cfg ...
    generating custom ti.sysbios library makefile ... 
    	Linking with library ti.drv.usb:./lib/am574x/a15/release/ti.drv.usb.aa15fg
    	Linking with library ti.board:./lib/idkAM574x/a15/release/ti.board.aa15fg
    	Linking with library ti.drv.i2c:./lib/am574x/a15/release/ti.drv.i2c.aa15fg
    	Linking with library ti.drv.uart:./lib/am574x/a15/release/ti.drv.uart.aa15fg
    	Linking with library ti.osal:./lib/tirtos/a15/release/ti.osal.aa15fg
    	Linking with library ti.csl:./lib/am574x/a15/release/ti.csl.aa15fg
    Starting build of library sources ...
    making C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/am57xx/src/sysbios/sysbios.aa15fg ...
    gmake[1]: Entering directory `C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/am57xx/src/sysbios'
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/IntrinsicsSupport_asm_gnu.asm ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/TaskSupport_asm_gnu.asm ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/timers/dmtimer/Timer_asm_gnu.sv7A ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/a15/smp/Cache_asm_gnu.asm ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/a15/Mmu_asm_gnu.asm ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/gic/Hwi_asm_gnu.asm ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/exc/Exception_asm_gnu.asm ...
    asma15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/systimer/Timer_asm_gnu.asm ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/BIOS.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/IntrinsicsSupport.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/TaskSupport.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Clock.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Idle.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Intrinsics.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Queue.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Semaphore.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Swi_smp.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/knl/Task_smp.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/hal/Cache.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/hal/Core.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/hal/Hwi.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/hal/Hwi_stack.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/hal/Hwi_startup.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/shared/vayu/IntXbar.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/shared/vayu/TimerSupport.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/timers/dmtimer/Timer.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/timers/dmtimer/TimestampProvider.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/v7a/smp/GateSmp.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/a15/smp/Cache.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/a15/smp/Core.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/a15/Mmu.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/rts/gnu/ReentSupport.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/gic/Hwi.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/exc/Exception.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/gates/GateHwi.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/gates/GateMutex.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/heaps/HeapMem.c ...
    cla15fg C:/ti/bios_6_73_00_12/packages/ti/sysbios/family/arm/systimer/Timer.c ...
    ara15fg arm_IntrinsicsSupport_asm_gnu.o arm_TaskSupport_asm_gnu.o dmtimer_Timer_asm_gnu.o smp_Cache_asm_gnu.o a15_Mmu_asm_gnu.o gic_Hwi_asm_gnu.o exc_Exception_asm_gnu.o systimer_Timer_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_smp.o knl_Task_smp.o hal_Cache.o hal_Core.o hal_Hwi.o hal_Hwi_stack.o hal_Hwi_startup.o vayu_IntXbar.o vayu_TimerSupport.o dmtimer_Timer.o dmtimer_TimestampProvider.o smp_GateSmp.o smp_Cache.o smp_Core.o a15_Mmu.o gnu_ReentSupport.o gic_Hwi.o exc_Exception.o gates_GateHwi.o gates_GateMutex.o heaps_HeapMem.o systimer_Timer.o ...
    gmake[1]: Leaving directory `C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/am57xx/src/sysbios'
    Build of libraries done.
    cla15fg package/cfg/usb_arm_am574x_idk_pa15fg.c ...
    Finished building: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/am57xx/usb_arm_am574x_idk.cfg"
     
    Building file: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/dev_bulk_main.c"
    Building file: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common/timer.c"
    Building file: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/usb_bulk_structs.c"
    Invoking: GNU Compiler
    "C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dam5728 -Dcore0 -DUSE_BIOS -DTIRTOS -DidkAM574x -DSOC_AM574x -Dgcc -I"C:/ti/pdk_am57xx_1_0_12/packages/MyExampleProjects/USB_DevBulk_idkAM574x_armExampleProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/" -I"C:/ti/pdk_am57xx_1_0_12/packages" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/usb_func/include" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/include" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -mno-unaligned-access -MMD -MP -MF"dev_bulk_main.d" -MT"dev_bulk_main.o"  @"configPkg/compiler.opt" -o"dev_bulk_main.o" "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/dev_bulk_main.c"
    Invoking: GNU Compiler
    Invoking: GNU Compiler
    "C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dam5728 -Dcore0 -DUSE_BIOS -DTIRTOS -DidkAM574x -DSOC_AM574x -Dgcc -I"C:/ti/pdk_am57xx_1_0_12/packages/MyExampleProjects/USB_DevBulk_idkAM574x_armExampleProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/" -I"C:/ti/pdk_am57xx_1_0_12/packages" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/usb_func/include" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/include" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -mno-unaligned-access -MMD -MP -MF"timer.d" -MT"timer.o"  @"configPkg/compiler.opt" -o"timer.o" "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common/timer.c"
    "C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dam5728 -Dcore0 -DUSE_BIOS -DTIRTOS -DidkAM574x -DSOC_AM574x -Dgcc -I"C:/ti/pdk_am57xx_1_0_12/packages/MyExampleProjects/USB_DevBulk_idkAM574x_armExampleProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/" -I"C:/ti/pdk_am57xx_1_0_12/packages" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/usb_func/include" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/include" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -mno-unaligned-access -MMD -MP -MF"usb_bulk_structs.d" -MT"usb_bulk_structs.o"  @"configPkg/compiler.opt" -o"usb_bulk_structs.o" "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/usb_bulk_structs.c"
    Building file: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common/usb_osal.c"
    Invoking: GNU Compiler
    "C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a15 -mtune=cortex-a15 -marm -mfloat-abi=hard -Dam5728 -Dcore0 -DUSE_BIOS -DTIRTOS -DidkAM574x -DSOC_AM574x -Dgcc -I"C:/ti/pdk_am57xx_1_0_12/packages/MyExampleProjects/USB_DevBulk_idkAM574x_armExampleProject" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include/newlib-nano" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/" -I"C:/ti/pdk_am57xx_1_0_12/packages" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/usb_func/include" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common" -I"C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/src/include" -I"C:/ti/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/include" -Og -g -gdwarf-3 -gstrict-dwarf -Wall -c -mno-unaligned-access -MMD -MP -MF"usb_osal.d" -MT"usb_osal.o"  @"configPkg/compiler.opt" -o"usb_osal.o" "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common/usb_osal.c"
    Finished building: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common/timer.c"
    Finished building: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/usb_dev/bulk/usb_bulk_structs.c"
     
     
    Finished building: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/common/usb_osal.c"
     
    Finished building: "C:/ti/pdk_am57xx_1_0_12/packages/ti/drv/usb/example/bios/dev_bulk_main.c"
     
    Building target: "USB_DevBulk_idkAM574x_armExampleProject.out"
    Invoking: GNU Linker
    "C:/ti/gcc-arm-none-eabi-6-2017-q1-update/bin/arm-none-eabi-gcc.exe" -mtune=cortex-a15 -marm -Dam5728 -Dcore0 -DUSE_BIOS -DTIRTOS -DidkAM574x -DSOC_AM574x -Dgcc -Og -g -gdwarf-3 -gstrict-dwarf -Wall -mno-unaligned-access -mfloat-abi=hard -Wl,-Map,"USB_DevBulk_idkAM574x_armExampleProject.map" -nostartfiles -static -Wl,--gc-sections -L"C:/ti/bios_6_73_00_12/packages/gnu/targets/arm/libs/install-native/arm-none-eabi/lib/hard" -Wl,--defsym,CORE0=1 -Wl,--defsym,STACKSIZE=0x10000 -Wl,--defsym,HEAPSIZE=0x400 --specs=nano.specs -o"USB_DevBulk_idkAM574x_armExampleProject.out" "./dev_bulk_main.o" "./timer.o" "./usb_bulk_structs.o" "./usb_osal.o" -Wl,-T"configPkg/linker.cmd" -Wl,--start-group -lrdimon -lgcc -lm -lc -Wl,--end-group 
    makefile:148: recipe for target 'USB_DevBulk_idkAM574x_armExampleProject.out' failed
    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal\lib\tirtos\a15\release\ti.osal.aa15fg(CacheP_tirtos.oa15fg): In function `CacheP_wb':
    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal/src/tirtos/CacheP_tirtos.c:63: undefined reference to `ti_sysbios_family_arm_a15_Cache_wb__E'
    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal\lib\tirtos\a15\release\ti.osal.aa15fg(CacheP_tirtos.oa15fg): In function `CacheP_wbInv':
    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal/src/tirtos/CacheP_tirtos.c:67: undefined reference to `ti_sysbios_family_arm_a15_Cache_wbInv__E'
    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal\lib\tirtos\a15\release\ti.osal.aa15fg(CacheP_tirtos.oa15fg): In function `CacheP_Inv':
    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal/src/tirtos/CacheP_tirtos.c:72: undefined reference to `ti_sysbios_family_arm_a15_Cache_inv__E'
    collect2.exe: error: ld returned 1 exit status
    gmake[1]: *** [USB_DevBulk_idkAM574x_armExampleProject.out] Error 1
    gmake: *** [all] Error 2
    makefile:144: recipe for target 'all' failed
    
    **** Build Finished ****

    smp_usb.pdf

  • Kaka,

    Can you try using the ti.sysbios.family.arm.a15.smp.Cache module instead of the ti.sysbios.family.arm.a15.Cache module in the .cfg? I would edit the file as a text file instead of via XGConf.

    Todd
  • Hi,

    Thank you very much for your kindness.

    I really appreciate your help.

     

    We tried using the ti.sysbios.family.arm.a15.smp.Cache module instead of the ti.sysbios.family.arm.a15.Cache module in the .cfg which you guided.

    But we found the other Errors like below.

    (Please refer attached pdf & txt in the previous post)

    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal\lib\tirtos\a15\release\ti.osal.aa15fg(CacheP_tirtos.oa15fg): In function `CacheP_wb':

    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal/src/tirtos/CacheP_tirtos.c:63: undefined reference to `ti_sysbios_family_arm_a15_Cache_wb__E'

    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal\lib\tirtos\a15\release\ti.osal.aa15fg(CacheP_tirtos.oa15fg): In function `CacheP_wbInv':

    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal/src/tirtos/CacheP_tirtos.c:67: undefined reference to `ti_sysbios_family_arm_a15_Cache_wbInv__E'

    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal\lib\tirtos\a15\release\ti.osal.aa15fg(CacheP_tirtos.oa15fg): In function `CacheP_Inv':

    C:\ti\pdk_am57xx_1_0_12\packages\ti\osal/src/tirtos/CacheP_tirtos.c:72: undefined reference to `ti_sysbios_family_arm_a15_Cache_inv__E'

    collect2.exe: error: ld returned 1 exit status

    gmake[1]: *** [USB_DevBulk_idkAM574x_armExampleProject.out] Error 1

     

    We would appreciate if you check the behavior and tell us how to solve this problem.

     

    Best regards,

  • It looks like the CacheP module in the PDK was written to be used with the non-SMP Cache module. In the CacheP_tirtos.c file, I see the following

    #if defined (SOC_AM335x)

    #include <ti/sysbios/family/arm/a8/Cache.h>

    #elif defined (SOC_AM437x)

    #include <ti/sysbios/family/arm/a9/Cache.h>

    #elif defined (__ARM_ARCH_7A__)

    #include <ti/sysbios/family/arm/a15/Cache.h>


    So it is explicitly using the non-SMP APIs. Since you are include the SMP version in the .cfg (and not the non-SMP ones), you are getting unresolved symbols. 

    Someone on the PDK team needs to look at this and determine the best plan to move forward with this. I've moved this thread to them.

    Todd

  • Hi,

    Thank you very much for your prompt reply.
    I really appreciate your help.

    We are waiting the next update.

    Best regards,
  • Hi,

    Thank you for your help.
    Do you have any update?

    Now, our customer is waiting for the answer.

    I would appreciate if you tell us about the progress on this.

    Best regards,
  • matusan, sorry for the delay.
    now that the holidays are over, you should expect a reply soon.
  • Hi,

    The Processor SDK RTOS driver example was not tested for SMP mode. You can refer to the e2e.ti.com/.../758370 for the same issue when converting a non-SMP project into SMP.

    The TI RTOS OSAL library was pre-built with #include <ti/sysbios/family/arm/a15/Cache.h>. It is not intended for SMP support. For SMP purpose, #include <ti/sysbios/family/arm/a15/smp/Cache.h> should be used and rebuild the OSAL library. Please try this and if it worked.

    Regards, Eric
  • Hi,

    Thank you very much for your kindness.
    I really appreciate your help.

    It seems to be success to build.
    Thank you!

    Best regards,
  • Hi Eric,

    Please let me confirm the following questions.
    [Question.1]
    Does the device Driver like USB, mmcsd, emac, UART, edma and so on work on SMP-mode?
    Have you already done the verification test for thoes AM57x driver with SMP environment?

    [Question.2]

    > The Processor SDK RTOS driver example was not tested for SMP mode

    Do you mean that the Device driver supported the SMP mode but the sample code was not tested with SMP mode on Processor SDK?

    Best regards.
    Kaka

  • Hi,

    The AM57x device driver supports SMP mode, however we didn't do any driver test with SMP. The available one is the POSIX-SMP example: software-dl.ti.com/.../index_examples_demos.html

    Also See processors.wiki.ti.com/.../BIOS for general guideline.

    Regards, Eric
  • Hi Eric,

    Thank you for your response.
    I understand that the AM57x driver supports the SMP mode but the sample code in PSDK did not tested with the SMP. Rihgt?

    Also, how did you confirm the AM57x drivers will work on SMP mode? If you did not test the Driver with SMP mode, we would like to request to you to do this test on your side.

    Best regards.
    Kaka

  • Kaka,

    When users enable SMP mode in TI RTOS, they are required to include the SMP aware modules for LoggerBug, SysMin, Core and Cache so there is some additional modification required to migrate the application to work in SMP mode.

    A good starting point for users wanting to enable SMP mode in TI RTOS is to review the material here:

    http://processors.wiki.ti.com/index.php/SMP/BIOS

     Also, refer to the following training to understand how to convert an existing RTOS application created in non-SMP (AMP) mode to SMP mode and the performance implication of this mode of operation on core kernel benchmarks.

    http://processors.wiki.ti.com/images/1/14/Public_SmpBiosSlides.pdf

    Please update the .cfg file as shown in attached .cfg file:

    /**
     *  \file   usb_arm_am572x_idk.cfg
     *
     *  \brief  Sysbios config file for UART example project on AM572X IDK EVM.
     *
     */
    
    /*
     * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * Redistributions of source code must retain the above copyright
     * notice, this list of conditions and the following disclaimer.
     *
     * Redistributions in binary form must reproduce the above copyright
     * notice, this list of conditions and the following disclaimer in the
     * documentation and/or other materials provided with the
     * distribution.
     *
     * Neither the name of Texas Instruments Incorporated nor the names of
     * its contributors may be used to endorse or promote products derived
     * from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
     */
    /* ================ General configuration ================ */
    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    var Diags = xdc.useModule('xdc.runtime.Diags');
    var Error = xdc.useModule('xdc.runtime.Error');
    var Log = xdc.useModule('xdc.runtime.Log');
    //var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
    var Main = xdc.useModule('xdc.runtime.Main');
    var Memory = xdc.useModule('xdc.runtime.Memory')
    //var SysMin = xdc.useModule('xdc.runtime.SysMin');
    var LoggerBuf = xdc.useModule('ti.sysbios.smp.LoggerBuf');
    var SysMin = xdc.useModule('ti.sysbios.smp.SysMin');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');
    var Clock = xdc.useModule('ti.sysbios.knl.Clock');
    var Swi = xdc.useModule('ti.sysbios.knl.Swi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var IntXbar      = xdc.useModule('ti.sysbios.family.shared.vayu.IntXbar');
    var Program      = xdc.useModule("xdc.cfg.Program");
    var Timer        = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
    /*
     * Program.argSize sets the size of the .args section.
     * The examples don't use command line args so argSize is set to 0.
     */
    /* Program.argSize = 0x0; */
    Program.heap            = 0x10000;
    
    /* System stack size (used by ISRs and Swis) */
    Program.stack = 0x20000;
    
    /*
     * Uncomment this line to globally disable Asserts.
     * All modules inherit the default from the 'Defaults' module.  You
     * can override these defaults on a per-module basis using Module.common$.
     * Disabling Asserts will save code space and improve runtime performance.
    Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
     */
    
    /*
     * Uncomment this line to keep module names from being loaded on the target.
     * The module name strings are placed in the .const section. Setting this
     * parameter to false will save space in the .const section.  Error and
     * Assert messages will contain an "unknown module" prefix instead
     * of the actual module name.
    /*Defaults.common$.namedModule = false;*/
    
    /*
     * Create and install logger for the whole system
     */
    var loggerBufParams = new LoggerBuf.Params();
    loggerBufParams.numEntries = 16;
    var logger0 = LoggerBuf.create(loggerBufParams);
    Defaults.common$.logger = logger0;
    Main.common$.diags_INFO = Diags.ALWAYS_ON;
    
    /* ================ BIOS configuration ================ */
    
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.smpEnabled = true;
    /*
     * Build a custom SYS/BIOS library from sources.
     */
    BIOS.libType = BIOS.LibType_Custom;
    
    BIOS.heapSize = 0x10000;
    
    /* ================ Driver configuration ================ */
    /* CSL - for Cross bar configuration - if needed */
    var deviceType           = "am572x";
    var Csl         = xdc.loadPackage('ti.csl');
    Csl.Settings.deviceType  = deviceType;
    
    /* Load the OSAL package */
    var osType           = "tirtos";
    var Osal             = xdc.loadPackage('ti.osal');
    Osal.Settings.osType = osType;
    
    /* Load the uart package */
    var socType           = "am572x";
    var Uart              = xdc.loadPackage('ti.drv.uart');
    Uart.Settings.socType = socType;
    
    /* Load the I2C package - board package needs this to read EVM ID */
    var I2c = xdc.loadPackage('ti.drv.i2c');
    I2c.Settings.socType = socType;
    
    /* Load the Board package and set the board name */
    var Board = xdc.loadPackage('ti.board');
    Board.Settings.boardName = "idkAM572x";
    
    var Usb = xdc.loadPackage('ti.drv.usb');
    var usbSettings = xdc.useModule('ti.drv.usb.Settings');
    usbSettings.socType = "am572x";
    usbSettings.libProfile = "release";
    
    /* fat file system for USB host example */
    var Fatfs = xdc.loadPackage('ti.fs.fatfs');
    
    /* ================ Cache and MMU configuration ================ */
    
    //var Cache1  = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
    var Cache1 = xdc.useModule('ti.sysbios.family.arm.a15.smp.Cache');
    var Mmu    = xdc.useModule('ti.sysbios.family.arm.a15.Mmu');
    
    /* Enable cache */
    Cache1.enableCache = true;
    
    /* Enable the MMU (Required for L1 data caching) */
    Mmu.enableMMU = true;
    
    var attrs = new Mmu.DescriptorAttrs();
    Mmu.initDescAttrsMeta(attrs);
    attrs.type = Mmu.DescriptorType_BLOCK;
    attrs.noExecute = true;
    attrs.accPerm = 0;       // R/W at PL1
    attrs.attrIndx = 7;      // Use MAIR0 Byte7
    Mmu.setMAIRMeta(7, 0x04);
    
    Mmu.setSecondLevelDescMeta(0x43200000, 0x43200000, attrs);
    Mmu.setSecondLevelDescMeta(0xA0000000, 0xA0000000, attrs); /* APP_UNCACHED_DATA_BLK3_MEM */
    
    /* Set IO Delay configuration areas as non-cache */
    attrs.attrIndx = 1;
    Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs); /* IODELAYCONFIG */
    Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs); /* ? */
    
    Mmu.setSecondLevelDescMeta(0x48880000, 0x48880000, attrs); /* USB1 */
    Mmu.setSecondLevelDescMeta(0x488C0000, 0x488C0000, attrs); /* USB2 */
    
    
    
    /* ================ Memory sections configuration ================ */
    Program.sectMap["BOARD_IO_DELAY_DATA"] = "OCMC_RAM1";
    Program.sectMap["BOARD_IO_DELAY_CODE"] = "OCMC_RAM1";
    Program.sectMap[".bss:extMemNonCache:usbXhci"]              = "APP_UNCACHED_DATA_BLK3_MEM";
    Program.sectMap[".bss:extMemCache:ramdisk"]                 = new Program.SectionSpec();
    Program.sectMap[".bss:extMemCache:ramdisk"].loadSegment     = "APP_CACHED_DATA_BLK2_MEM";
    Program.sectMap[".bss:extMemCache:ramdisk"].type            = "NOLOAD";
    

    Currently, there is a known issue with OS abstraction layer(OSAL) when using RTOS Cache APIs that causes a linking issue. To resolve it, they can update the  CacheP_tirtos.c file in location 

    /*
     * Copyright (c) 2015-2018, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    /*
     *  ======== HwiP_tirtos.c ========
     */
    
    #include <ti/osal/CacheP.h>
    #include <ti/sysbios/BIOS.h>
    
    #if defined (SOC_AM335x) 
    #include <ti/sysbios/family/arm/a8/Cache.h>
    #elif defined (SOC_AM437x)
    #include <ti/sysbios/family/arm/a9/Cache.h>
    #elif defined (__ARM_ARCH_7A__)
    #include <ti/sysbios/family/arm/a15/smp/Cache.h>
    #elif defined (__TI_ARM_V7M4__)
    #include <ti/sysbios/hal/unicache/Cache.h>
    #elif defined (__TI_ARM_V7R4__)
    #include <ti/sysbios/family/arm/v7r/Cache.h>
    #elif defined (__TI_ARM_V5__)  
    #include <ti/sysbios/family/arm/arm9/Cache.h>
    #elif defined (_TMS320C6X) && !(defined (SOC_OMAPL137) || defined (SOC_OMAPL138))
    #include <ti/sysbios/family/c66/Cache.h>
    #elif defined(__aarch64__)
    #include <ti/sysbios/family/arm/v8a/Cache.h>
    #else
    #include <ti/sysbios/hal/Cache.h>
    #endif
    
    
    void CacheP_wb(const void * addr, int32_t size)
    {
    
       Cache_wb((Ptr)addr, (SizeT)size, (Bits16)Cache_Type_ALL, (Bool)TRUE);
    }
    void CacheP_wbInv(const void * addr, int32_t size)
    {
       Cache_wbInv((Ptr)addr, (SizeT)size, (Bits16)Cache_Type_ALL, (Bool)TRUE);
    }
    
    void CacheP_Inv(const void * addr, int32_t size)
    {
      Cache_inv((Ptr)addr, (SizeT)size, (Bits16)Cache_Type_ALL, (Bool)TRUE);
    }
    /* Nothing past this point */
    

    To Rebuild OSAL:

    cd pdk_am57xx_x_xx_xx\packages

    pdksetupenv.bat

    cd ti\osal

    gmake LIMIT_SOC=am572x LIMIT_CORES=a15_0

    There is a broader plan to cover the Processor SDK RTOS driver examples testing to cover for SMP mode. Our expectation is that there should be no modification to the driver code as the TI RTOS kernel and the OS abstraction level(OSAL) should handle both modes of operation.

    Regards,

    Rahul

  • Hi Rahul,

    Thank you for your detail.
    Would you please confirm the following question?

    [Question.1]

    This problem of link error in SMP mode with PDK. Since the following functions are only Undefined Symbol. 
    ti_sysbios_family_arm_a15_Cache_wb__E
    ti_sysbios_family_arm_a15_Cache_wbInv__E
    ti_sysbios_family_arm_a15_Cache_inv__E

    So, Customer prepared a wrapper to connect to smp/Cache.h like below.
    They will use this solution until you will modify this issue. How do you think?

    [Solution]

    //// main.cfg(cfg file) ///////////////////////////

    // @@ for SMP add-S
    BIOS.smpEnabled = true;
    // Chose "true" or "false".
    // ("false" = same as not set).
    // @@ for SMP add-E

    // @@ for SMP add-S

    if (BIOS.smpEnabled) {
    var Core = xdc.useModule('ti.sysbios.family.arm.a15.smp.Core');
    Core.useSkernelCmd = false; /* Set to false if running in CCS and using gel files to wake-up secondary cores */
    Core.numCores = 2;
    var Cache = xdc.useModule('ti.sysbios.family.arm.a15.smp.Cache');

    var SysStd = xdc.useModule('ti.sysbios.smp.SysStd');
    var SysMin = xdc.useModule('ti.sysbios.smp.SysMin');
    var LoggerBuf = xdc.useModule('ti.sysbios.smp.LoggerBuf');
    } else {
    var Core = xdc.useModule('ti.sysbios.hal.Core');
    var Cache = xdc.useModule('ti.sysbios.family.arm.a15.Cache');
    var SysStd = xdc.useModule('xdc.runtime.SysStd');
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
    }
    // @@ for SMP add-E

    //// Cache wrapper for PDK driver used for SMP system
    /*
    * dymmy_cache.c
    */

    #define MP_MODE_SINGLE_ONLY (0)
    #define MP_MODE_AMP (1)
    #define MP_MODE_SMP (2)
    #define MP_MODE MP_MODE_SMP
    // #define MP_MODE MP_MODE_SINGLE_ONLY

    #if (MP_MODE == MP_MODE_SMP)

    #include <ti/sysbios/family/arm/a15/smp/Cache.h>
    Void ti_sysbios_family_arm_a15_Cache_wb__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
    {
    Cache_wb(blockPtr, byteCnt, type, wait);
    }

    Void ti_sysbios_family_arm_a15_Cache_wbInv__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
    {
    Cache_wbInv(blockPtr, byteCnt, type, wait);
    }

    Void ti_sysbios_family_arm_a15_Cache_inv__E(Ptr blockPtr, SizeT byteCnt, Bits16 type, Bool wait)
    {
    Cache_inv(blockPtr, byteCnt, type, wait);
    }
    #endif //

    [Question.2]
    Is there a compile SW that can check the value of "BIOS.smpEnabled" ?

    Best regards.
    Kaka

  • KAka,

    I believe the above solution will work from the application without having to update/modify the OSAL. You can put the conditional statement in the configuration file to be able to switch your application build to use SMP aware modules when required. Also, the link issues with the Cache module will be resolved since the application provides dummy functions that will link to the OSAL symbols.

    Yes, if your application includes the file BIOS.h then there is a flag "BIOS_smpEnabled" defined  which during RTOS compilation picks up the boolean value defined from the .cfg setting of BIOS.smpEnabled from the configuration file.

    TI RTOS XDC build auto generates a file <projectName>_pa15fg.c in the folder DEbug/configPkg/package/cfg folder that gets compiled in application. This file defines the value as a FAR const that gets picked up by the #define BIOS_enabled when you include BIOS.h file (located at ti/sysbios/BIOS.h in bios package)

    For example check my UART Example code where SMP is enabled:

    Hope this helps. Let us know if there are any other questions.

    Regards,

    Rahul