LPC54102 power library --ropi

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54102 power library --ropi

Jump to solution
1,164 Views
cameron_j_moore
Contributor I

I'm trying to compile and link with -ropi against a sample project. If I initialize the board (LPCxpresso 54102) in the bootloader and jump to the relocatable code everything is fine, but trying to link the necessary startup items (Board_SystemInit which eventually calls the power_library) fails miserably. I really don't understand why.

Specifically I'm just trying to make the following work:

                    AREA HANDLER, CODE, READONLY
                    IMPORT SystemInit                           ; this fails for unknown reasons
                    IMPORT __main                                ; this works fine

                    ...

main_entry          DCD __main + 2 - .
sys_entry            DCD SystemInit + 6 - .

The Link Errors I'm getting because of the IMPORT SystemInit line are:

.\Objects\pic.axf: Error: L6248E: power_library.o(i.__set_voltage) in PI region 'ER_IROM1' cannot have address type relocation to [Anonymous Symbol] in PI region 'ER_IROM1'.

.\Objects\pic.axf: Error: L6285E: Non-relocatable Load region LR_IROM1 contains R-Type dynamic relocations. First R-Type dynamic relocation found in power_library.o(i.__set_voltage) at offset 0x1230.

And since the power library is closed source, it's difficult to figure out what I need to do. This should be possible, I just need more insight. Thanks.

Labels (1)
1 Solution
972 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Cameron Moore,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
If you want to load the power lib in your project, I'd like to point you to refer to the power_manager_lpc demo in the LPC54102's SDK library, please give a try.
SDK library: MCUXpresso SDK|NXP
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
972 Views
cameron_j_moore
Contributor I

I should mention I'm using Keil uVision 5. 

0 Kudos
973 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Cameron Moore,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
If you want to load the power lib in your project, I'd like to point you to refer to the power_manager_lpc demo in the LPC54102's SDK library, please give a try.
SDK library: MCUXpresso SDK|NXP
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------