This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Code Composer Studio
Greetings,
I am trying to run the tcpEcho example on a custom board which has an Ethernet section the same as the one in the EK-TM4C1294XL development kit.
When loading the code (proven to run in the development kit, verifying tools and related equipment) it fails with the following output:
FSR = 0x0004
HFSR = 0x40000000
DFSR = 0x00000000
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...
Tracing execution, the code enters an abnormal termination at Hwi_HwiProxy_switchFromBootStack(); (Hwi.c)
The error is non recoverable.
In order to run with a fixed IP address the following was added to the *.cfg file
Ip.autoIp = false;
Ip.address = "192.168.1.12";
Ip.mask = "255.255.255.0";
Ip.domainName = "mydomain";
Ip.socketMaxConnections = 4;
Ip.socketTimeToLive = 64;
This was confirmed to work with the SDK.
Several of my colleagues have reported the same issue on different projects. It is suspected that there is a configuration issue for the tool.
I would appreciate to be able to speak to an engineer that would help getting passed this issue. Development time is seriously impacted.
Thank you
Greetings,
More information on the subject.
ROV evaluation data:
address 0x2000fb64
activeInterrupt: 3
pendingInterrupt: 35
Exception: Yes
hwiStackPeak: 956
hwiStackSize: 2048
Basic Data:
Type: dispatched
Int No: 35
Priority: 224
Group: 7
fxn: ti_sysbios_family_arm_lm4_Timer_isrStub_E
Decoded: Hard Fault: FORCED:USAGE:INVPCBUSFAULT:IBUSERR
Exception Context
$addr 0x2000f5b4
$type ti.sysbios.family.arm.m3.Hwi.ExcContext
ThreadType ti.sysbios.BIOS.ThreadType_Task
Hi
Can you confirm if the identical code runs on the launchpad but not the custom board? If the identical code runs on the launchpad but not your custom board then it seems to have something to do with the custom board. If you have a different code that is creating the hard fault problem, can you run this code on the launchPad? Does it fail the same?
In the meantime, this video may have you troubleshoot common TI-RTOS issues.
https://training.ti.com/debugging-common-application-issues-ti-rtos
Hello Charles,
The only thing different between the development kit and the custom board is that the custom board uses JTAG as the debug interface (Segger J-Link) and does not have the Stellaris device.
The code is the tcpEcho example and it has been reduced to the least possible:
Hi Carlos,
Yes, the interrupt 35 is the Timer0. Please note that the Timer0 is taken by BIOS for the system tick. What you are seeing is normal even in the absence of the EMAC. Are you saying that with only the BIOS_start() and everything else commented out, you are getting a hard fault or you are just getting an timer0 interrupt?
I meant the hard fault is still observed with only the BIOS_start();
I am using the Segger J-Link jtag interface.
ok, I'm going to run the same example (the tcpEcho_EK_TM4C1294XL_TI) on my LaunchPad to see if I can reproduce it. I want to make sure two things.
1. You can observe the hard fault with the tcpEcho_EK_TM4C1294XL_TI example as is. The example you are using is the below one.
2. You can observe the hard fault on the launchPad board.
Hello Charles,
Yes that is the example and it fails with only the BIOS_start() call in my custom board.
At this point there should be no interaction with anything external other than the clock which is providing the 25MHz and is structured the same as the development kit.
The difference is that in the development kit the debug interface is through the Stelaris device while in my board it is J-Link (Segger) I don't assume that is the issue.
I have ran other examples such as the uart_echo and the blinky with no issues.
Hi Carlos,
Can you please answer me if you have run the exact same example on the 'launchPad', not your custom board? I can only run the example on the launchPad. I've just run it for a couple of minutes and I don't see any hard fault.
I don't think the debug interface has anything to do with the problem.
At the bottom of this post, I attached the tcpEcho example I just run. I didn't comment out any lines. I just run as is. I do not see any hard fault. Again, I run it on my launchPad. This is the reason I asked if you can see the hard fault on the launchPad. If you can see the hard fault on launchPad, then we can debug the problem. If the problem only occurs on your custom board then it will be more difficult. I don't know if there is any difference between the example you run and mine. Therefore, I suggest you try my attached example. If you can see hard fault, then please let me know how long you need to run to see it.
I use the provided executable tirtos_tivac_2_16_00_08\packages\examples\tools\tcpSendReceive.exe to send/receive data with the MCU. For details. refer to the tcpEcho_readme.txt file in the project directory.
Below is the screenshot on the PC side.
Below is the console on the MCU side. As can be seen I don't see the hard fault after running for a couple of minutes.
Here is the example project I used.
Hello Charles
The example runs in the development board (I believe that was in the problem statement).
This effort is already passed that point in which I am attempting to get the same example running on the custom board configured in the same manner as the development kit.
The initial estimation was that there is something essentially different in HW that caused the Hard fault, however, the nature of the fault that being a timer interrupt which is not connected to any external input and by removing all other executing code to isolate BIOS_start() is the reason for my reaching to you (I have already done the A and B comparison and have already tested my computer, cables, development kit, compiler environment, code and others)
At this point I would like to figure out the reason for that Hard Fault specially if it is an internal process (internal resource).
I mentioned before that one difference is the use of the JTAG interface and perhaps there is a timing issue with the HW or there is a configuration difference. Other colleagues using the same processor with custom boards different than mine also see the same issue (they too use the JTAG interface.)
Thank you for your help,
Hi Carlos,
Thank you for confirming that the problem is only observed on your customer board. Honestly, I can't connect the dots yet as to why the same code will produce different results in two different boards.
1. Can you tell me which ti-rtos version you are running? I'm using tirtos_tivac_2_16_00_08. Although your problem seems to be hardware related, I still wanted to make sure the software doesn't play any role in your problem.
2. Can you increase the stack size? Again, most likely it won't make a difference to the result, I just wanted to try different knobs.
3. Have you compared your board schematic with the launchPad schematic? Is there any difference?
4. Can you try the non TI-RTOS ethernet example? The TivaWare library has some Ethernet examples such as enet_io and enet_lwip. What happen if you run these examples on your custom board? Run them on both your launchPad and custom board. Will you again see fault only on the custom board but not the launchPad?
Hello Charles
I have tirtos_tivac_2_16_00_08.
I will follow your recommendation and change the stack size to test.
I have compared the schematics for this section in specific. They are the same including components.
I will also try other examples for the tiva sources.
Thank you for your support
Hello Charles,
Would the report below be related?
In case here is my config file:
Thank you for your support
Hi Carlos,
Is this the .cfg file directly from the TcpEcho example? Did you modify the cfg file?
In additional to the suggestions in my last post, can you also try running some non Ethernet related TI-RTOS examples? The reason I'm asking is because you said with most of the lines commented out and only the BIOS_start() remain, you are getting hard fault in the TcpEcho example. What about non Ethernet examples?
Also what about UDPEcho example?
Hello Charles
More information on the issue below, Basically using ROV to get the Sp, lr and PC to get back to the point of failure, it takes me to the HWi assembly module that handles stack initialization ( Hwi_asm_switch.sv7M )
I just cannot get out of this!
I have read the comments in the file which suggest that the CPU needs to reset before running. I perform the reset and have the same result.
Indeed I have everything else commented out and only BIOS_start() is called.
I will try udp_echo next
Thank you for your support,
The code:
Hi Carlos,
I assume this udpEcho example will just run fine in your LaunchPad. Is that correct? If this is the case, I really don't have a clue what is causing the problem. Did you have a chance to run the non TI-RTOS Ethernet example? You can pick the enet_io example from the TivaWare library.
I have a few more questions and suggestions.
1. As I just asked above, does the TI-RTOS udpEcho example run fine on your launchPad?
2. As I just asked above, did you run the enet_io example? What is the result?
3. You have the custom board. This mean the device that was shipped to you is fresh without the MAC address. Did you program your own MAC address that was assigned to your company?
4. How many custom boards do you have? Can you repeat the same problem in all your custom boards?
5. What TIRTOS version are you using?
6. In your subject heading, you specify the part number as TM4C1294NCPDT. Can you please confirm the part number again?
7. This suggestion may be more time consuming but I'm still going to suggest to you. Can you do a ABBA test? This is to swap the MCU on your lauchPad to your customer board and also to swap the MCU on your custom board to the LaunchPad. What will be the results?
Hello Charles
Thank you for your reply. Below are my answers:
1. As I just asked above, does the TI-RTOS udpEcho example run fine on your launchPad?
A: Correct. I tested the application in the lauchpad before attempting to run the same in my board
2. As I just asked above, did you run the enet_io example? What is the result?
A: Not yet, it is next. I need a fix IP address (figuring out how to disable DHCP and set my IP)
3. You have the custom board. This mean the device that was shipped to you is fresh without the MAC address. Did you program your own MAC address that was assigned to your company?
A: Correct, however I am programming my company's MAC in EK_TM4C1294XL.c line 221
/*
* EMAC configuration structure
* Set user/company specific MAC octates. The following sets the address
* to ff-ff-ff-ff-ff-ff. Users need to change this to make the label on
* their boards.
*/
unsigned char macAddress[6] = {my company MAC here};
4. How many custom boards do you have? Can you repeat the same problem in all your custom boards?
A; we have few, tried on 3 same result
5. What TIRTOS version are you using?
A: tirtos_tivac_2_16_00_08
6. In your subject heading, you specify the part number as TM4C1294NCPDT. Can you please confirm the part number again?
A: Yes TM4C1294NCPDT (same as the EK-TM4C1294XL board)
7. This suggestion may be more time consuming but I'm still going to suggest to you. Can you do a ABBA test? This is to swap the MCU on your lauchPad to your customer board and also to swap the MCU on your custom board to the LaunchPad. What will be the results?
A:Test my understanding: The suggestion is to remove the CPU from my board and the one from the launchpad and solder them back-on on the other board? I am afraid that would be destructive for both and may lose my development HW.
Could you share how to program the MAC on the device? ( a long shot but worth trying )
Thank you for your time,
Hi Carlos,
Thank you for answering my questions.
Carlos Alva said:A:Test my understanding: The suggestion is to remove the CPU from my board and the one from the launchpad and solder them back-on on the other board? I am afraid that would be destructive for both and may lose my development HW.
Honestly, I think this is the best way to diagnose what happen to your problem. If the MCU from the launchPad is swapped to your custom board and if it works then it confirms that your custom board is good. If it doesn't then it is a board problem to investigate. If you swap the MCU from your custom board to the launchPad and if it works, then we can confirm your MCU is good. If it does work, then then we need to investigate the MCU.
I think this step is really worth your trying as I don't have any clues now as to why an identical program works on the launchPad but not your custom board. I can understand if there is a board problem then the Ethernet may not work. But your problem is a hard fault, that doesn't look like an Ethernet problem. At least I haven't been able to connect the dots between hard fault and Ethernet. Perhaps I need to ask you one more time. Did you run any non Ethernet TI-RTOS examples. There are many TI-RTOS examples which are non Ethernet related. Can you repeat the same problem. If these examples are working fine, at least we can narrow down only to the Ethernet examples. Please also confirm if the enet_io works or now. If the enet_io does not work on your custom board then we will know it is only Ethernet related.
Carlos Alva said:Could you share how to program the MAC on the device? ( a long shot but worth trying
What debug probe do you have? I believe you have the Jlink, correct? You can use the Uniflash to program the MAC address in the User0/User1 register. It will be permanently stored in the non-volatile memory.
Hello Charles
For your last question regarding running another application that is not Ethernet related, the answer is yes (it is in one of my earlier posts) I was able to run Blinky without any issues in my board. I was able to modify the PIO configurations to actuate other outputs without issues.
I have also been able to run uart_Echo without issues.
Hi Carlos,
Thanks. From all the information I have from you so far is that the problem is Ethernet related. It could be a software issue or a hardware issue. But I just don't know which one is the root cause. I'm still waiting the result from:
1. enet_io example test.
2. ABBA test.
3. Program the MAC address to USER0/USER1 register using the Uniflash and see if it makes a difference. I know you already configured the MAC address in the EK_TM4C1294XL.c file. I also try it myself with an empty MAC address in the USER0/USER1 registers but program the MAC address in the EK_TM4C1294XL.c file and it also works for me on the launchPad. I will suggest for the time being, program the TI MAC address to your custom board. Your company's assigned MAC address should be fine. Is it possible that there are multiple same MAC address boards hooked up to your LAN. Unlikely scenarios but just wanted to make sure.
Thank you for your reply,
I am keeping the board isolated from our network (against policy to attach a non approved device to the network)
At the moment I am working with a fixed IP (which in the case of tcpEcho I program in the *.cfg file, tested in the lauchpad)
Given that the issue is the HWi initialization as a result of BIOS_start, it suggests that the stack is not initialized or that somehow the PC or SP are changing and sending execution to an uninitialized area. The ASM code does a push and pop, the comments in the code suggest a CPU reset required to start and unwind interrupts. I perform the reset before attempting to run (same result)
I am starting to suspect the J-Tag interface (Segger J-Link) perhaps memory addressing and or register read/write may have an issue (only theorizing at the moment)
Thank you for your time
Hi Carlos,
Were you saying that the pop instruction was popping to an un-initialized area? Can you compare the lauchPad and custom board while you are tracing the code?
I still like to know the result of enet_io. It shouldn't take you much time to run the as-is example.
Hello Charles,
I have since been able to run. It may be a workaround of sorts but I am able to run code. For some reason, I need to reset and restart the processor after loading even if I get the exception (11) and the abnormal termination and register dump. The board runs with no issues on subsequent power ups.
I'll take this and continue development.
Thank you for your support.
Incidentally, I have downloaded the flash programmer to program the MAC address on urs0 and usr1 locations, could you provide detailed steps please (address process etc) thank you so much
Hi Carlos,
Glad you are able to move on with your development.
In my reply on Thu, Feb 6 2020 9:24 AM, I have shown how to program the MAC addresses using Uniflash programmer. Please refer to that post. If you have new questions such as programming the USR0/USR1 registers please open a new thread instead of continuing on this thread. Thanks.
Hi Carlos,
I just tried it and noticed the same. I don't support the Uniflash tool. Can you please open a new thread to the CCS forum. I don't want to forward this thread to the CCS team as this thread has too many back and forth posts on not related to the Uniflash and it is too long for the CCS team to go through. So please open a new thread to the CCS forum and they will assist you.