Hi,

Since every mynewt package built as standalone library, possibly this is the case: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15833.html Anyway, IMO, it would be better to avoid use of weak linkage. It's a bit confusing. May be the better choice is to add some kind of stm32_cpu_specific_setup() call to stm32_common package.

BR,
Andrey


On 16.05.2018 05:35, markus wrote:
I'm sure it's just my newt kung-fu that isn't strong enough, here is
what I'm trying to do:

in the package hw/mcu/stm/stm32_common there is a function called
(let's say):

stm32_hal_timer_get_freq

for specific processors I want to overwrite that function, so I
implement the same function in package hw/mcu/stm/stm32f3xx.

Now I tought if I make the implementation in stm32_common a weak symbol
the linker would pick up the processor specific version if one was
supplied.

As it turns out that's not the case. The reason seeming to be that
stm32_common is linked before stm32f3xx, so the linker resolve the
symbol from stm32_common.

If I rename the package "stm32_common" to "~stm32_common" it gets
linked after "stm32f3xx" and the linker picks up the correct
implementation.

Is there a better way of telling newt to link one library before
another one?

Note that the stm32f3xx package has a dependency on the
stm32_common package

Reply via email to