Project working with connected debugger, crashes when USB is disconnected

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello

I am developing a project on Aurix TC297-A step board, under Hightec environment and Gnuc compiler.
The project has a function of UDP server (lwIP stack ported to ERIKA rtos). The program works correctly while USB cable
and debugger (universal debug engine - UDE) are connected, but when USB cable is disconnected and the program is
restarted, it won't work.

Did anyone have similar issues, and how to handle with this problem?

Josip
0 Likes
1 Reply
Not applicable
By further research, I figured out where the problem is located. The problem is with one of Ethernet reserved registers located in Ifx_Eth_reg.h:

/** \brief 2018, Register 6 - Operation Mode Register */
#define ETH_OPERATION_MODE /*lint --e(923)*/ (*(volatile Ifx_ETH_OPERATION_MODE *)0xF001F018u)

When the USB cable is connected and the program is running, program in one of its parts tries to write a simple "1" to a bit field located in this register
and it does it successfuly, but when USB cable is disconnected, this bit field can not be accessed for some strange reason and program crashes.
Is it possible that low level Ethernet drivers including this problematic register are not written correctly for this board? Can I somehow change the used
register location? Is it possible that USB connection uses this register aswell for some reason?

Josip
0 Likes