Hi all,
I have an application with RTX5 and works fine but need to add a FlashFS and this is the beginning ofthe problem. FlashFS is not compatible with microLIB and need to uncheck the "use microLib" from the target options, the project is compiled ok and the kernel starts ok but quickly raises a hard fault exception and can't get find the reason because the code is the same and the debugger don't helps so much.
Is RTX not compatible with the default C library and only works with microLIB? Is possible to get the FlashFS run with microLIB?
Thanks
Hi Robert,
Thanks for your explanation. I tried to give more stack and heap but the problem stills. I'm using the stack watermark for the debugger and all is ok in the RTX RTOS viewer. I can't understand why the kernel throw the HardFault and in the Fault Reports window any checkbox is checked, everything seems to be ok...
Sorry, I wanted to put no checkbox is checked, not any :)
Try to determine why the HardFault occurred by examining the Call Stack.
You can also use the Event Recorder to see what RTX5 is doing and where the problem could be.
You can also create a support ticket ...
Hi,
Yes, the event recorder helps me... the problem is suddently the ethernet comes down (error LinkDownError 'no link'), this occurs after try to resolve IP with the DNS component. This error not occurs with microLIB.
Event, Time (sec), Component, Event Property, Value 0, 0.01416540, , Init Event, Restart Count=0x00000001 1, 22.41152390, Op : NET, InitSystem, ver=7.4.0 2, 22.41159040, Op : NET, InitMemory, pool_size=12000 limit0=12000 limit1=9000 3, 22.41166910, Op : NET, InitInterface, eth0 4, 22.41228700, Op : NET, SetMacAddress, mac=1E-30-6C-A2-45-5E 5, 22.41575910, Op : NET, InitCache, entries=10 6, 22.41602750, Op : NET, InitInterface, loopback 7, 22.41606930, Op : NET, InitCore, ip4 8, 22.41611720, Op : NET, PingInit, ping 9, 22.41616150, Op : NET, InitSockets, sockets=5 10, 22.41621100, Op : NET, InitSockets, sockets=6 mss=1440 11, 22.41628200, Op : NET, InitClient, vcid=0 opt=0 12, 22.41632810, Op : NET, SocketAllocated, sock=1 13, 22.41637200, Op : NET, StartClient, 14, 22.41641320, Op : NET, OpenSocket, sock=1 port=68 15, 22.41648280, Op : NET, InitClient, entries=10 16, 22.41653160, Op : NET, SocketAllocated, sock=2 17, 22.41658740, Op : NET, InitClient, mode=Unicast 18, 22.41663880, Op : NET, SocketAllocated, sock=3 19, 22.41696970, Op : NET, InitComplete, success 20, 22.41711030, Op : NET, Resolve, name=http://www.google.com 21, 22.41744160, Op : NET, OpenSocket, sock=2 port=0 22, 22.41750200, Op : NET, OpenLocalPortAssigned, loc_port=49152 23, 22.41756860, Op : NET, AllocMemory, size=28 (used=28 blocks=1) 24, 22.41775190, Op : NET, AllocMemory, size=108 (used=136 blocks=2) 25, 22.41785360, Op : NET, SendRequestIp4, dns=8.8.8.8 26, 22.41790130, Detail : NET, ShowFrameHeader, tid=0xB95B flags=0x0100 qd=1 an=0 ns=0 ar=0 27, 22.41799880, Op : NET, SendFrame, sock=2 len=32 28, 22.41807090, Detail : NET, ShowFrameHeader, dst_port=53 src_port=49152 cksum=0x0000 len=40 29, 22.41812300, Op : NET, SendFrame, proto=UDP len=40 30, 22.41817630, Detail : NET, ShowFrameHeader, dst=8.8.8.8 src=0.0.0.0 proto=UDP id=0x0000 len=60 31, 22.41828220, Op : NET, SendFrame, len=74 ver=IPv4 32, 22.41832290, Error : NET, LinkDownError, no-link 33, 22.41839070, Op : NET, FreeMemory, size=108 (used=28 blocks=1)
Te problem is not solving the ip, if I place a "while (1)" after "netStart()" the hardfault is trowed, no error in recorder log but INVPC bit is set in fault reports.
I tried to solve the problem in my real application, not the example posted. My application mix CMSIS and initialization of peripherals with CubeMX, for any reason if I use microLIB the program runs ok but when use standard C Library the program crashes. Finally I rewrite the application only with CMSIS library without using code from CubeMXand works ok... I think there is a problem mixing CubeMX and CMSIS but the compiler don't show any warning or problem.
I bet it was semihosting. Semihosting was enabled, when it should be disabled in CubeMX project. CMSIS project may have disabled it. You can tell if this is the case, by looking in the map file for "__I$use$semihosting".
Microlib disables semihosting automatically.
For an application with Standard library, use:
IMPORT __use_no_semihosting
in an assembly file: developer.arm.com/.../using-the-libraries-in-a-nonsemihosting-environment
Then try a build. This will give errors for any semihosting functions that were removed. Re-define the semihosting functions that were stripped away. The Manage Run-Time Environment re-defines some of these functions under Compiler, automatically, if you retarget some output, by checking some boxes there. Some of these can be defined as empty functions, without affecting the program.
Some can be re-defined as:
void _sys_<whatever> ( int ch ) { }
In C++, just add:
extern "C"
at beginning to get C linkage.
If you are still troubleshooting with CubeMX export to MDK, use the following guide: www.keil.com/.../_troubleshooting.html
Hi Zack,
You are a source of wisdom :) lol
Thanks one more time, I will try it.
Tried your solution an added the __sys_exit() function but the problem stills... I think will continue by the only CMSIS way without MX.
I am having a similar issue getting a bootloader working - so; what was the answer here?
Thanks, John W.