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.

Loadable sections in secure boot

Other Parts Discussed in Thread: OMAP-L138

Hi TI experts

I am using secure boot feature on C6748, while reviewing the code of OMAP-L138 Secure UART Boot Host tool, I recognize for each input image *.out, it scans all loadable sections, encrypts its data and then writes AIS command to the device through UART (function AISSecureSectionLoad in SecureAISGen.cs). I am having a requirement to put a global variable to a subsection of .data section, like below:

#pragma DATA_SECTION(m_data, ".data:m_data");

unsigned char m_data[100] = {0, 1, 2, 3, ..., 99};

In sys/bios configuration .cfg file, I put

Program.sectMap[".data:m_data"] = new Program.SectionSpec();
Program.sectMap[".data:m_data"].loadSegment = "DDR";
Program.sectMap[".data:m_data"].loadAlign = 0x20;

But when debugging the Secure UART Boot tool, this subsection .data:m_data is marked as not loadable, and as a result this section will not be encrypted. My questions are:

1. If a section is not loadable, how this section is encrypted and put to output AIS secure image?

2. When I declare m_data as const unsigned char m_data[100], it is then recognized as loadable section. Why there is this difference?

3. Is there any scenarios when I should declare m_data with far keyword? : far const unsigned char m_data[100]

Thank you very much,

Long

  • Long,

    Just for your information, the dark highlighting makes it difficult for me to read the text underneath it. If I make mistakes in my advice, I may have misread some of it.

    1. Some sections are loadable and some sections are not. Data variable space is not loaded if it does not have data that must be set at load time. You are probably using the -c linker switch that causes the variable initialization to be done at run-time instead of at load-time. The encryption will be done in the -cinit section which is loadable.

    2. The .const section is also loadable.

    3. If you want the data variable to be placed in the .far section, then use the far keyword.

    You can find more information on all of these in the Compiler User's Guide and the Assembly Language Tools Reference Guide for your tools versions.

    Regards,
    RandyP