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.

specify code section for functions in library

Expert 1215 points


Hi,

Is there a way to specify certain functions in library to reside in one code section while the rest in another? For example, I want memcpy and a few math functions in IRAM and the rest of rts in SDRAM.

Thanks

 

  • I think you need to rebuild the RTS (or at least the specific source files). I do not believe there is a way to tell the linker to place specific functions from an object file.

    If you rebuild the RTS you can use the #pragma CODE_SECTION(...) to create a custom code section and then specify where to place it in your linker command file. For more information on the CODE_SECTION pragma see the Compiler Guide.

  • While the Pragma suggestion I made in the previous post is still correct and perfectly valid I wanted to clarify that you can indeed specify specific symbols from the RTS object files to be placed separately. This is because the RTS Library is built with the -mo option which generates a different compiler section for each symbol. I don't know if there's a way to default every other RTS function to SDRAM, but I'll look into this. For now know that you can use something like the below to place specific symbols into IRAM.

    .text:_memcpy > IRAM

  • Thanks.

    What about putting one entire lib, e.g. fastmath67x.lib, in a section?

  • One final update for now. Section 7.8 of the Assembly Guide shows how to accomplish the other part, but thus far I have not been able to get this to build properly. I will have to research this more at a later time.