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.

[参考译文] AM263X-MCAL SDK:AM2634 多核存储器问题–添加功能块时 Core0 应用程序停止工作

Guru**** 2893300 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1625551/am263x-mcal-sdk-am2634-multicore-memory-issue-core0-application-stops-working-when-adding-functional-block

器件型号:AM263X-MCAL SDK

尊敬的团队:

我正在处理一个使用 带多核配置的工程。  


设置:

  • Core0:应用层+服务层(操作系统:NORTOS)

  • Core1:以太网协议栈(操作系统:FreeRTOS)

  • SDK:MCU+ SDK ()

  • IDE:Code Composer Studio

    处于释放模式
    当我直接运行两个内核时、core0 正常工作 、但 core1 不工作。

    在调试模式下
    core0 有时工作、core1 有时不工作
    我怀疑这是内存问题、因为当我从内核 0 减少一些功能块时、它开始工作、你能帮我解决这个问题。

    我共享我的核心文件和 linker.cmd 文件

    Core0:-

     /* This is the stack that is used by code running within main()
      * In case of NORTOS,
      * - This means all the code outside of ISR uses this stack
      * In case of FreeRTOS
      * - This means all the code until vTaskStartScheduler() is called in main()
      *   uses this stack.
      * - After vTaskStartScheduler() each task created in FreeRTOS has its own stack
      */
    
     --stack_size=16384
    /* This is the heap size for malloc() API in NORTOS and FreeRTOS
    * This is also the heap used by pvPortMalloc in FreeRTOS
    */
     --heap_size=32768
    -e_vectors  /* This is the entry of the application, _vector MUST be placed starting address 0x0 */
    
    /* This is the size of stack when R5 is in IRQ mode
     * In NORTOS,
     * - Here interrupt nesting is enabled
     * - This is the stack used by ISRs registered as type IRQ
     * In FreeRTOS,
     * - Here interrupt nesting is enabled
     * - This is stack that is used initally when a IRQ is received
     * - But then the mode is switched to SVC mode and SVC stack is used for all user ISR callbacks
     * - Hence in FreeRTOS, IRQ stack size is less and SVC stack size is more
     */
    __IRQ_STACK_SIZE = 256;
    /* This is the size of stack when R5 is in IRQ mode
     * - In both NORTOS and FreeRTOS nesting is disabled for FIQ
     */
    __FIQ_STACK_SIZE = 256;
    __SVC_STACK_SIZE = 4096; /* This is the size of stack when R5 is in SVC mode */
    __ABORT_STACK_SIZE = 256;  /* This is the size of stack when R5 is in ABORT mode */
    __UNDEFINED_STACK_SIZE = 256;  /* This is the size of stack when R5 is in UNDEF mode */
    
    
    
    SECTIONS
    {
        .vectors  : {
        } > R5F_VECS   , palign(8) 
    
    
        GROUP  :   {
        .text.hwi : {
        } palign(8)
        .text.cache : {
        } palign(8)
        .text.mpu : {
        } palign(8)
        .text.boot : {
        } palign(8)
        .text:abort : {
        } palign(8)
        } > OCRAM  
    
    
        GROUP  :   {
        .text : {
        } palign(8)
        .rodata : {
        } palign(8)
        } > OCRAM  
    
    
        GROUP  :   {
        .data : {
        } palign(8)
        } > OCRAM  
    
    
        GROUP  :   {
        .bss : {
        } palign(8)
        RUN_START(__BSS_START)
        RUN_END(__BSS_END)
        .sysmem : {
        } palign(8)
        .stack : {
        } palign(8)
        } > OCRAM  
    
    
        GROUP  :   {
        .irqstack : {
            . = . + __IRQ_STACK_SIZE;
        } align(8)
        RUN_START(__IRQ_STACK_START)
        RUN_END(__IRQ_STACK_END)
        .fiqstack : {
            . = . + __FIQ_STACK_SIZE;
        } align(8)
        RUN_START(__FIQ_STACK_START)
        RUN_END(__FIQ_STACK_END)
        .svcstack : {
            . = . + __SVC_STACK_SIZE;
        } align(8)
        RUN_START(__SVC_STACK_START)
        RUN_END(__SVC_STACK_END)
        .abortstack : {
            . = . + __ABORT_STACK_SIZE;
        } align(8)
        RUN_START(__ABORT_STACK_START)
        RUN_END(__ABORT_STACK_END)
        .undefinedstack : {
            . = . + __UNDEFINED_STACK_SIZE;
        } align(8)
        RUN_START(__UNDEFINED_STACK_START)
        RUN_END(__UNDEFINED_STACK_END)
        } > OCRAM  
    
    
        GROUP  :   {
        .ARM.exidx : {
        } palign(8)
        .init_array : {
        } palign(8)
        .fini_array : {
        } palign(8)
        } > OCRAM  
    
        .bss.user_shared_mem (NOLOAD) : {
        } > USER_SHM_MEM    
    
        .bss.log_shared_mem (NOLOAD) : {
        } > LOG_SHM_MEM    
    
        .bss.ipc_vring_mem (NOLOAD) : {
        } > RTOS_NORTOS_IPC_SHM_MEM    
    
        .bss.sipc_hsm_queue_mem (NOLOAD) : {
        } > MAILBOX_HSM    
    
        .bss.sipc_secure_host_queue_mem (NOLOAD) : {
        } > MAILBOX_R5F    
    }
    
    
    MEMORY
    {
        R5F_VECS   : ORIGIN = 0x0 , LENGTH = 0x40 
        R5F_TCMA   : ORIGIN = 0x40 , LENGTH = 0x7FC0 
        R5F_TCMB   : ORIGIN = 0x80000 , LENGTH = 0x8000 
        SBL   : ORIGIN = 0x70000000 , LENGTH = 0x40000 
        OCRAM   : ORIGIN = 0x70040000 , LENGTH = 0xA0000
        USER_SHM_MEM   : ORIGIN = 0x701D0000 , LENGTH = 0x4000 
        LOG_SHM_MEM   : ORIGIN = 0x701D4000 , LENGTH = 0x4000 
        FLASH   : ORIGIN = 0x60100000 , LENGTH = 0x80000 
        RTOS_NORTOS_IPC_SHM_MEM   : ORIGIN = 0x72000000 , LENGTH = 0x3E80 
        MAILBOX_HSM   : ORIGIN = 0x44000000 , LENGTH = 0x3CE 
        MAILBOX_R5F   : ORIGIN = 0x44000400 , LENGTH = 0x3CE 
    
        /* For memory Regions not defined in this core but shared by other cores with the current core */
    
    
    }
    

酷睿 1:-  

 /* This is the stack that is used by code running within main()
  * In case of NORTOS,
  * - This means all the code outside of ISR uses this stack
  * In case of FreeRTOS
  * - This means all the code until vTaskStartScheduler() is called in main()
  *   uses this stack.
  * - After vTaskStartScheduler() each task created in FreeRTOS has its own stack
  */

 --stack_size=16384
/* This is the heap size for malloc() API in NORTOS and FreeRTOS
* This is also the heap used by pvPortMalloc in FreeRTOS
*/
 --heap_size=32768
-e_vectors  /* This is the entry of the application, _vector MUST be placed starting address 0x0 */

/* This is the size of stack when R5 is in IRQ mode
 * In NORTOS,
 * - Here interrupt nesting is enabled
 * - This is the stack used by ISRs registered as type IRQ
 * In FreeRTOS,
 * - Here interrupt nesting is enabled
 * - This is stack that is used initally when a IRQ is received
 * - But then the mode is switched to SVC mode and SVC stack is used for all user ISR callbacks
 * - Hence in FreeRTOS, IRQ stack size is less and SVC stack size is more
 */
__IRQ_STACK_SIZE = 256;
/* This is the size of stack when R5 is in IRQ mode
 * - In both NORTOS and FreeRTOS nesting is disabled for FIQ
 */
__FIQ_STACK_SIZE = 256;
__SVC_STACK_SIZE = 4096; /* This is the size of stack when R5 is in SVC mode */
__ABORT_STACK_SIZE = 256;  /* This is the size of stack when R5 is in ABORT mode */
__UNDEFINED_STACK_SIZE = 256;  /* This is the size of stack when R5 is in UNDEF mode */



SECTIONS
{
    .vectors  : {
    } > R5F_VECS   , palign(8) 


    GROUP  :   {
    .text.hwi : {
    } palign(8)
    .text.cache : {
    } palign(8)
    .text.mpu : {
    } palign(8)
    .text.boot : {
    } palign(8)
    .text:abort : {
    } palign(8)
    } > OCRAM  


    GROUP  :   {
    .text : {
    } palign(8)
    .rodata : {
    } palign(8)
    } > OCRAM  


    GROUP  :   {
    .data : {
    } palign(8)
    } > OCRAM  


    GROUP  :   {
    .bss : {
    } palign(8)
    RUN_START(__BSS_START)
    RUN_END(__BSS_END)
    .sysmem : {
    } palign(8)
    .stack : {
    } palign(8)
    } > OCRAM  


    GROUP  :   {
    .irqstack : {
        . = . + __IRQ_STACK_SIZE;
    } align(8)
    RUN_START(__IRQ_STACK_START)
    RUN_END(__IRQ_STACK_END)
    .fiqstack : {
        . = . + __FIQ_STACK_SIZE;
    } align(8)
    RUN_START(__FIQ_STACK_START)
    RUN_END(__FIQ_STACK_END)
    .svcstack : {
        . = . + __SVC_STACK_SIZE;
    } align(8)
    RUN_START(__SVC_STACK_START)
    RUN_END(__SVC_STACK_END)
    .abortstack : {
        . = . + __ABORT_STACK_SIZE;
    } align(8)
    RUN_START(__ABORT_STACK_START)
    RUN_END(__ABORT_STACK_END)
    .undefinedstack : {
        . = . + __UNDEFINED_STACK_SIZE;
    } align(8)
    RUN_START(__UNDEFINED_STACK_START)
    RUN_END(__UNDEFINED_STACK_END)
    } > OCRAM  


    GROUP  :   {
    .ARM.exidx : {
    } palign(8)
    .init_array : {
    } palign(8)
    .fini_array : {
    } palign(8)
    } > OCRAM  

    .bss.user_shared_mem (NOLOAD) : {
    } > USER_SHM_MEM    

    .bss.log_shared_mem (NOLOAD) : {
    } > LOG_SHM_MEM    

    .bss.ipc_vring_mem (NOLOAD) : {
    } > RTOS_NORTOS_IPC_SHM_MEM    

    .bss.sipc_hsm_queue_mem (NOLOAD) : {
    } > MAILBOX_HSM    

    .bss.sipc_secure_host_queue_mem (NOLOAD) : {
    } > MAILBOX_R5F    

    .bss:ENET_CPPI_DESC (NOLOAD) : {
    } > CPPI_DESC   , align(128) 

    .bss:ENET_DMA_PKT_MEMPOOL (NOLOAD) : {
    } > OCRAM   , align(128) 


}


MEMORY
{
    R5F_VECS   : ORIGIN = 0x0 , LENGTH = 0x40 
    R5F_TCMA   : ORIGIN = 0x40 , LENGTH = 0x7FC0 
    R5F_TCMB   : ORIGIN = 0x80000 , LENGTH = 0x8000 
    OCRAM   : ORIGIN = 0x700EF000 , LENGTH = 0xE1000 
    CPPI_DESC   : ORIGIN = 0x70080000 , LENGTH = 0x4000 
    FLASH   : ORIGIN = 0x60180000 , LENGTH = 0x80000 

    /* For memory Regions not defined in this core but shared by other cores with the current core */

    USER_SHM_MEM   : ORIGIN = 0x701D0000 , LENGTH = 0x4000  
    LOG_SHM_MEM   : ORIGIN = 0x701D4000 , LENGTH = 0x4000  
    RTOS_NORTOS_IPC_SHM_MEM   : ORIGIN = 0x72000000 , LENGTH = 0x3E80  
    MAILBOX_HSM   : ORIGIN = 0x44000000 , LENGTH = 0x3CE  
    MAILBOX_R5F   : ORIGIN = 0x44000400 , LENGTH = 0x3CE  

}
 

 

在这里、我无法共享.map 文件、如果需要、请告诉我另一种共享方式

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、  

    对延迟的回复表示歉意。 您能查看以下内容吗?

    1.可以尝试通过刷写应用程序来运行项目吗? 您能否刷写 SBL 和应用程序并进行一次检查? 这是为了确保通过 GEL 脚本实现 SoC 初始化不会出现问题。

    您可以从 MCU + SDK 中使用此 SBL: mcu_plus_sdk_am263x_11_01_00_19/examples/drivers/boot/sbl_qsp_dorply_elf

    2.当你说 core1 不工作时,你能告诉我到底发生了什么事吗? 内核是否卡在某些中止/异常中?

    3.在调试模式下、内核 0 和内核 1 的观察结果是否相同?

    4.你能检查你是否有足够的堆栈和堆内存?

    此致、

    Aswin