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.

[参考译文] LAUNCHCC3235MOD:MbedTLS 消耗大量代码、没有 OTA 空间

Guru**** 2558250 points


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

https://e2e.ti.com/support/wireless-connectivity/wi-fi-group/wifi/f/wi-fi-forum/1566587/launchcc3235mod-mbedtls-consuming-code-size-no-room-for-ota

器件型号:LAUNCHCC3235MOD


工具/软件:

您好:

我已成功连接到 MQTT 服务器 mqtt_client_Example(不带 TLS 和 simplelink_cc32xx_SDK_6_10_00_05) 和 mqtt_client_over_tls_1_3 示例(使用必要的 TLS 证书和 simplelink_cc32xx_SDK_7_10_00_13)  。  

但问题是、我可以使用 SDK6 示例来制作 OTA、映像大小约为 200KB、但我不会执行任何 OTA、因为 TLS 映像大小为 517KB(实际上是 522KB、我禁用了 wifi Direct 功能)。

.cmd 文件:

#define SRAM_BASE   0x20000000
#define FLASH_BASE  0x01000800

--stack_size=1024   /* C stack is also used for ISR stack */
--retain "*(.resetVecs)"

/* Set severity of diagnostics to Remark instead of Warning                  */
/* - 10068: Warning about no matching log_ptr* sections                      */
--diag_remark=10068

HEAPSIZE = 0x8000;  /* Size of heap buffer used by HeapMem */

MEMORY
{
    /* Bootloader uses FLASH_HDR during initialization */
    FLASH_HDR (RX)  : origin = 0x01000000, length = 0x7FF      /* 2 KB */
    FLASH     (RX)  : origin = 0x01000800, length = 0x0FF800   /* 1022KB */
    SRAM      (RWX) : origin = 0x20000000, length = 0x00040000 /* 256KB */
    /* Explicitly placed off target for the storage of logging data.
     * The data placed here is NOT loaded onto the target device.
     * This is part of 1 GB of external memory from 0x60000000 - 0x9FFFFFFF.
     * ARM memory map can be found here:
     * developer.arm.com/.../about-the-memory-map
     */
    LOG_DATA (R) : origin = 0x90000000, length = 0x40000        /* 256 KB */
    LOG_PTR  (R) : origin = 0x94000008, length = 0x40000        /* 256 KB */
}

/* Section allocation in memory */
SECTIONS
{
    .dbghdr     : > FLASH_HDR
    .resetVecs  : > 0x01000800
    .text       : > FLASH
    .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
    .const      : > FLASH
    .rodata     : > FLASH
    .cinit      : > FLASH
    .pinit      : > FLASH
    .init_array : > FLASH

    .ramVecs    : > SRAM, type = NOLOAD, ALIGN(1024)
    .data       : > SRAM
    .bss        : > SRAM
    .sysmem     : > SRAM

    /* Heap buffer used by HeapMem */
    .priheap   : {
        __primary_heap_start__ = .;
        . += HEAPSIZE;
        __primary_heap_end__ = .;
    } > SRAM align 8

    .stack      : > SRAM(HIGH)
    .log_data       :   > LOG_DATA, type = COPY
    .log_ptr        : { *(.log_ptr*) } > LOG_PTR align 4, type = COPY
}

--symbol_map __TI_STACK_SIZE=__STACK_SIZE
--symbol_map __TI_STACK_BASE=__stack

-u_c_int00

查看 CCS 上的“Memory Allocation“窗口时、可以看到.text .mbedtls 主要在闪存上消耗。

TLS 连接成功、但没有空间用于 OTA。

如何减小代码大小? 我可以禁用一些 mbedtls 功能吗?

此致、

Onur

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

    尊敬的 Onur:

    我需要更深入地了解 TLS 示例以收集更多信息。 同时、为了进行确认、您说 OTA 更新超过 500KB、因此基于 TLS 程序映像的 MQTT 客户端占用的空间过大?

    谢谢、

    Brandon Liu

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

    尊敬的 Onur:

    我希望您做得好。

    如果您不想使用 mbedtls 第三方库、可以尝试使用 sdk/tlosocket.c 中的 src 代码(位于 sdk/TLS/ti/drivers/net/wifi/source)。

    此致、

    Brandon Liu