i.mx RT 105x and C++14

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

i.mx RT 105x and C++14

895 Views
muratcakmak
Contributor II

Hi all, 

I am seeing some odd behaviour with i.MX RT 1050 while implementing USB Host Mass Storage. 

When I use SDK example on the EVK with Armcc compiler, I dont see a problem which is great but when I try to port it to our project it somehow does not work, cannot detect the USB device. 

Our project is a C++14 project and we use GCC compiler. 

If I create .c file and put everything inside, it works well. The reset ISR calls the main() function which initialises MCU and USB Host and everything works. 

But If I call the main() function from C++ main() function which called from ResetISR, it does not work. 

ResetISR -> main() in main.c : works

ResetISR -> main() in main.cpp -> main() in main.c : USB Host Mass Storage does not work (I rename the main() in main.c if I call from the main() in main.cpp). 

Actually, main.cpp does not do anything, just calls the main() function in main.c, so everything is almost identical. 

I was having a similar issue with a variadic function as well. Even when I call an empty variadic function, USB Host Mass Storage does not work. If I don't call the empty variadic function, it works. 

I know, it is really odd. I am wondering can it be about unaligned instructions in our implementation, or a compiler bugs (C++14 for the CM7 MCUs).

I don't enable D/I Caches.

Any idea? 

Regards.

Murat

Labels (1)
0 Kudos
Reply
1 Reply

833 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Murat,

What's the IDE software you are using?

If possible, could you provide a demo project could help to regenerate this issue?Thanks.

best regards,

Mike

0 Kudos
Reply