Strange things happen when FreeRTOS code is moved to a static lib

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Strange things happen when FreeRTOS code is moved to a static lib

1,523件の閲覧回数
segev-amossi
Senior Contributor I

Hi,

I'm using the EVK of MIMXRT1176.

I basically run an app that uses FreeRTOS. I run it on Core-M7 (it's a dual core).

The program basically does nothing, by the way, it only runs a task that prints "hello world".

When I run everything using a single project, everything works fine, but when I separate the FreeRTOS code to another static library - things get out of hand, and really strange bugs occur.

Just to get things straight - it's exactly the same code, only moved to a static lib. 

Some of the strange things that happen - 

1. The program halts , and I get a message saying "Break at address "0x0" with no debug information available, or outside of program code." (see the Bug_1 attachment).

2. Another thing that happens from time to time is that the program doesn't even launch, and from then on I can't even use the microcontroller anymore, since it identifies the current core as Core-M4 instead of Core-M7 (on every program I tried to run it on!). I have to use the Boot-Utility in and perform a Mass Erase in order to use it again. 

When might cause such strange things? As I wrote earlier, I only switch the location from the App to a static lib.

Any help would be much appreciated,

Segev

0 件の賞賛
返信
1 返信

1,513件の閲覧回数
diego_charles
NXP TechSupport
NXP TechSupport

Hi @segev-amossi 

I hope that you are doing excellent.  I received the additional information you shared via email. 

I suppose that your whole program may look like below   and you have followed some procedure like described here How to create and use static library in MCUXpresso IDE

int main()
{
  init_periph, pins etc.
  rtos_static_lib_enter();// problem appears when executing lib functions
  return 0;
}

Are you able to share your project?

I think that we could take a look to :

  • Which section of memory is the static library is linked to. 
  • Monitor program counter when jumping to static library functions.
  • Test linking whole application to SRAM, or  link static library to SRAM using a linker script. Let me know if you need an example for this.

I mention this because I want to check if the static library is executing where we intend 

All the best,

Diego.

0 件の賞賛
返信