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.

RM46L852: launchxl2-rm46L852 freeRTOS blinking led

Part Number: RM46L852
Other Parts Discussed in Thread: HALCOGEN,

Hello everyone !

I'm trying to blink a led with freeRTOS. I've generated the code from halcogen for the RM46L852 and it's integrated FreeRTOS but i'm facing some issues with freeRTOS and also with the halcogen generated code...

Can someone  have a look at my project available here : https://github.com/babylone25/launchxl2-rm46L852.git ?

Thanks a lot !

Regards,

  • Hi Fabian,

    i'm facing some issues with freeRTOS and also with the halcogen generated code

    What are the issues? Is there any error when compiling the project? Did you follow the steps in the HALCoGen help to configure the device?

  • Hello QJ Wang,

    I don't have any errors when compiling but I've weird warnings :

    And the problem is when I run the project in debug mode I see that I'm stuck into the Task led creation.

    Best Regards,

  • I don't have any errors when compiling but I've weird warnings :

    I just imported your project in CCS 11 and got the same warnings:

    Invoking: Arm Linker
    "/home/mr_halfword/ti/ccs1100/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin/armcl" -mv7R4 --code_state=32 --float_support=VFPv3D16 -me --define=DEBUG --define=__LITTLE_ENDIAN__ --define=CSP_LITTLE_ENDIAN=1 --define=RM46L852 --define=TI_HERCULES_FAMILY --define=WATCHDOG_ENABLE=0 -g --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi --section_sizes=on -z -m"RM46L852.map" --heap_size=0x800 --stack_size=0x800 -i"/home/mr_halfword/ti/ccs1100/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/lib" -i"/home/mr_halfword/ti/ccs1100/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="RM46L852_linkInfo.xml" --rom_model -o "RM46L852.out" "./Third_party/FreeRTOS/source/hooks.obj" "./Third_party/FreeRTOS/source/os_croutine.obj" "./Third_party/FreeRTOS/source/os_event_groups.obj" "./Third_party/FreeRTOS/source/os_heap.obj" "./Third_party/FreeRTOS/source/os_list.obj" "./Third_party/FreeRTOS/source/os_mpu_wrappers.obj" "./Third_party/FreeRTOS/source/os_port.obj" "./Third_party/FreeRTOS/source/os_portasm.obj" "./Third_party/FreeRTOS/source/os_queue.obj" "./Third_party/FreeRTOS/source/os_tasks.obj" "./Third_party/FreeRTOS/source/os_timer.obj" "./Third_party/HAL/source/Device_RM46.obj" "./Third_party/HAL/source/Fapi_UserDefinedFunctions.obj" "./Third_party/HAL/source/adc.obj" "./Third_party/HAL/source/can.obj" "./Third_party/HAL/source/crc.obj" "./Third_party/HAL/source/dabort.obj" "./Third_party/HAL/source/dcc.obj" "./Third_party/HAL/source/ecap.obj" "./Third_party/HAL/source/emac.obj" "./Third_party/HAL/source/eqep.obj" "./Third_party/HAL/source/errata_SSWF021_45.obj" "./Third_party/HAL/source/esm.obj" "./Third_party/HAL/source/etpwm.obj" "./Third_party/HAL/source/gio.obj" "./Third_party/HAL/source/het.obj" "./Third_party/HAL/source/i2c.obj" "./Third_party/HAL/source/lin.obj" "./Third_party/HAL/source/mdio.obj" "./Third_party/HAL/source/mibspi.obj" "./Third_party/HAL/source/notification.obj" "./Third_party/HAL/source/phy_dp83640.obj" "./Third_party/HAL/source/pinmux.obj" "./Third_party/HAL/source/pom.obj" "./Third_party/HAL/source/rti.obj" "./Third_party/HAL/source/sci.obj" "./Third_party/HAL/source/spi.obj" "./Third_party/HAL/source/sys_core.obj" "./Third_party/HAL/source/sys_dma.obj" "./Third_party/HAL/source/sys_intvecs.obj" "./Third_party/HAL/source/sys_mpu.obj" "./Third_party/HAL/source/sys_pcr.obj" "./Third_party/HAL/source/sys_phantom.obj" "./Third_party/HAL/source/sys_pmm.obj" "./Third_party/HAL/source/sys_pmu.obj" "./Third_party/HAL/source/sys_selftest.obj" "./Third_party/HAL/source/sys_startup.obj" "./Third_party/HAL/source/sys_vim.obj" "./Third_party/HAL/source/system.obj" "./Third_party/HAL/source/ti_fee_Info.obj" "./Third_party/HAL/source/ti_fee_cancel.obj" "./Third_party/HAL/source/ti_fee_cfg.obj" "./Third_party/HAL/source/ti_fee_eraseimmediateblock.obj" "./Third_party/HAL/source/ti_fee_format.obj" "./Third_party/HAL/source/ti_fee_ini.obj" "./Third_party/HAL/source/ti_fee_invalidateblock.obj" "./Third_party/HAL/source/ti_fee_main.obj" "./Third_party/HAL/source/ti_fee_read.obj" "./Third_party/HAL/source/ti_fee_readSync.obj" "./Third_party/HAL/source/ti_fee_shutdown.obj" "./Third_party/HAL/source/ti_fee_util.obj" "./Third_party/HAL/source/ti_fee_writeAsync.obj" "./Third_party/HAL/source/ti_fee_writeSync.obj" "./application/source/app_led_task.obj" "./application/source/app_main.obj" "../Third_party/HAL/include/F021_API_CortexR4_LE.lib" "../Third_party/HAL/source/sys_link.cmd"  -lrtsv7R4_T_le_v3D16_eabi.lib 
    <Linking>
    warning #10247-D: creating output section ".kernelTEXT" without a SECTIONS specification
    warning #10247-D: creating output section ".kernelHEAP" without a SECTIONS specification
    warning #10247-D: creating output section ".kernelBSS" without a SECTIONS specification
    FILE: RM46L852.out
    CODE  size (bytes): 61832
    CONST size (bytes): 592
    DATA  size (bytes): 11396
    The warnings mean the linker hadn't seen the section specified in a linker command file, and so placed the named sections in an arbitrary memory region.

    The RM46L852/Debug/RM46L852.map link map file shows the .kernelTEXT, .kernelHEAP and .kernelBSS sections have all been placed in FLASH0. The .kernelHEAP and .kernelBSS sections need to be placed in RAM, and will cause the program to fail at runtime when placed in FLASH (as has happended to the sections not being specified in a linker command file).

    Looking at the linker command line from the build, the CCS project is passing the RM46L852/Third_party/HAL/source/sys_link.cmd linker command file to the linker. In that linker command file the SECTIONS don't contain .kernelTEXT, .kernelHEAP nor .kernelBSS :

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text    : {} > FLASH0 
        .const   : {} > FLASH0 
        .cinit   : {} > FLASH0 
        .pinit   : {} > FLASH0 
        .bss     : {} > RAM
        .data    : {} > RAM
        .sysmem  : {} > RAM
        
        FEE_TEXT_SECTION : {} > FLASH0 
        FEE_CONST_SECTION : {} > FLASH0
        FEE_DATA_SECTION : {} > RAM
    
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

    The RM46L852_FREERTOS/source/sys_link.cmd linker command file does contain the .kernelTEXT, .kernelHEAP and .kernelBSS sections:

    SECTIONS
    {
        .intvecs : {} > VECTORS
        /* FreeRTOS Kernel in protected region of Flash */
        .kernelTEXT   : {} > KERNEL
        .cinit        : {} > KERNEL
        .pinit        : {} > KERNEL
        /* Rest of code to user mode flash region */
        .text         : {} > FLASH0 
        .const        : {} > FLASH0 
        /* FreeRTOS Kernel data in protected region of RAM */
        .kernelBSS    : {} > KRAM
        .kernelHEAP   : {} > RAM
        .bss          : {} > RAM
        .data         : {} > RAM    
    
    /* USER CODE BEGIN (4) */
    /* USER CODE END */
    }

    It looks like the way the CCS project has been set the correct linker command file for FreeRTOS hasn't been used.

    How were the top-level RM46L852_FREERTOS and RM46L852 directories set up?

  • Hello Chester,

    Thanks for your detailed response it helps me a lot to understand where comes from those warnings.

    I've done a lot of things into that directory I'll try to go from a clean setup.

    Thanks for yout help !

    Best regards,

  • The top-level RM46L852_FREERTOS was set up through HALCOGEN and I've done by hand the RM46852 directory just adding the file hooks.h and hook.c from another project.

    If you copy the RM46L852_FREERTOS/source/sys_link.cmd file into the RM46L852/Third_party/HAL/source directory, i.e. overwriting the existing RM46L852/Third_party/HAL/source/sys_link.cmd, that will remove the warnings. I just tried that and no linker warnings and the linker map file shows what appears to be the correct placement of sections:

    SEGMENT ALLOCATION MAP
    
    run origin  load origin   length   init length attrs members
    ----------  ----------- ---------- ----------- ----- -------
    00000000    00000000    00006c60   00006c60    r-x
      00000000    00000000    00000020   00000020    r-x .intvecs
      00000020    00000020    00006bf0   00006bf0    r-x .kernelTEXT
      00006c10    00006c10    00000050   00000050    r-- .cinit
    00008020    00008020    00008578   00008578    r-x
      00008020    00008020    00008378   00008378    r-x .text
      00010398    00010398    00000200   00000200    r-- .const
    08000800    08000800    00000140   00000000    rw-
      08000800    08000800    00000140   00000000    rw- .kernelBSS
    08001000    08001000    00002b44   00000000    rw-
      08001000    08001000    00002000   00000000    rw- .kernelHEAP
      08003000    08003000    00000b28   00000000    rw- .bss
      08003b28    08003b28    0000001c   00000000    rw- .data

    However, it might be more maintainable to set up the RM46L852 directory as a HALCoGen generated project with FreeRTOS support so can re-generate the HALCoGen code when required.

  • Chester, sorry I reedited my answer before I saw you had answered the question...

    Indeed If I copy RM46L852_FREERTOS/source/sys_link.cmd file into the RM46L852/Third_party/HAL/source directory it removed the warnings thanks to you !

    But I tested the code with my launchpad and it doesn't work. I'm still stuck into my task creation... I think I will try to regenerate a project with HALCOGEN with the minimum FreeRTOS capabilities. Thanks a lot for your help Chester.

    Regards,

  • Since last week I got it done ! It’s available under https://github.com/babylone25/launchxl2-rm46L852.git. Thanks for your help.

    best regards