| FORUM

FEDEVEL
Platform forum

Unable to access network from SPI flash U-boot

LordSurly , 08-19-2024, 08:03 PM
Even when connected to a switch that is connected to other devices, PING fails with known IPs
QDrives , 08-20-2024, 07:48 PM
Even if the IP is "unknown", you should see ARP packets.
If you do not see anything, then there is either a software or hardware problem.
Since you mentioned that the OS can transmit correctly, that leaves the software issue.
I have no knowledge on U-boot, so I cannot help you there much.
https://stackoverflow.com/questions/49767954/arp-retry-count-exceeded-in-uboot
LordSurly , 08-21-2024, 03:19 AM
Yup, I've already seen this post, but thank you.
QDrives , 08-22-2024, 07:48 PM
Does the mii dump data match with the actual PHY?
LordSurly , 08-26-2024, 06:41 PM
Assuming you're referring to the MAC, I can't know because I can't find any information on how registers 2 & 3 map to an actual MAC.
QDrives , 08-26-2024, 07:27 PM
The MAC is in the ethernet controller. The PHY is external.
You communicate with the PHY through MDIO and MDCLK(?)
LordSurly , 08-26-2024, 08:05 PM
Right you are, I was conflating
LordSurly , 08-26-2024, 08:05 PM
Yeah, the PHY is accessible.
LordSurly , 08-26-2024, 08:05 PM
in u-boot
QDrives , 08-26-2024, 08:08 PM
If you connect it to something, do the "link" LEDs go on?
On both ends, just 1 or none?
LordSurly , 08-26-2024, 08:14 PM
link light on both ends. Linux on PC reports link is up
LordSurly , 08-26-2024, 08:14 PM
(from within u-boot)
QDrives , 08-26-2024, 08:15 PM
That means that the PHY is working, but the could still be from configuration of the OS. Or do you 'boot' into u-boot?
LordSurly , 08-26-2024, 08:16 PM
There's no OS issues. This issue is 100% on-board u-boot.
QDrives , 08-26-2024, 08:17 PM
Yes, you said so. My question is whether the OS has configured the PHY or that it could only be from u-boot.
QDrives , 08-26-2024, 08:18 PM
In other words: does it go directly to-u-boot as there is no OS?
LordSurly , 08-26-2024, 08:19 PM
I could remove the SD card, but u-boot is what boots the OS.
QDrives , 08-26-2024, 08:21 PM
Ok, clear.
Can/do you compile u-boot?
LordSurly , 08-26-2024, 08:22 PM
Yes, this entire subject is here because I wanted to replace u-boot, but you do that by using tftp, which won't work without network. To be clear, my original problem is OBE ...
QDrives , 08-26-2024, 08:27 PM
Replace u-boot through u-boot?
LordSurly , 08-26-2024, 08:29 PM
https://www.imx6rex.com/software/how-to-uboot-compile-flash-update/#uboot_from_sd
LordSurly , 08-26-2024, 08:29 PM
Yes, per option #2 in the link above
LordSurly , 08-26-2024, 08:32 PM
Though it's not clear to me exactly what that is doing; I assumed it was a new u-boot, It links to a random binary that has "loader" in the name 🤷
LordSurly , 08-26-2024, 08:33 PM
The basis for all of this was me making changes to the yocto u-boot, and wondering why it didn't work -- it's because the rex board has a built-in u-boot that was bypassing the u-boot on the sd card and booting the OS directly, thus the rabbit hole.
QDrives , 08-26-2024, 08:34 PM
It also mentions SPI.
How do you get the first bit of code running?
LordSurly , 08-26-2024, 08:35 PM
Not sure what you're referring to.
QDrives , 08-26-2024, 08:38 PM
Every CPU/MCU starts at a specific address.
On that address there needs to be some code that is executed.
It can be run from SD card, flash memory, etc. but not everything.
A PC has a BIOS for that.

What is the first bit of code that is run on a iMX cpu?
LordSurly , 08-26-2024, 08:39 PM
No idea, but an educated guess would be that it has a ROM bootloader? GIven the context, I assume it's in SPI flash.
QDrives , 08-26-2024, 08:40 PM
So you may need to replace the code in that flash. Through SPI perhaps.
LordSurly , 08-26-2024, 08:42 PM
As I said, my problem is OBE; this is more of an exercise in "why can't the factory u-boot use the network?" FWIW, this is something the the vendor (voipac) also can't answer.
QDrives , 08-26-2024, 08:43 PM
OBE stands for?
LordSurly , 08-26-2024, 08:44 PM
Overcome By Events -- though it's misused. Basically "no longer relevant."
LordSurly , 08-26-2024, 08:44 PM
Because I found an easier way to achieve my goals, but the issue of the network persists.
QDrives , 08-26-2024, 09:18 PM
Have you read/tried this:
Help! uBoot doesnt boot up.
If you accidentally flash a wrong u-boot, you can boot up through the USB cable and reflash it with a working one. Just follow the “Run uBoot on an empty module” steps.
LordSurly , 08-26-2024, 09:49 PM
At this point the question I'm trying to answer is "how do you get the factory u-boot to use the network." I didn't put u-boot on this device.
LordSurly , 08-26-2024, 09:49 PM
Or even "has the factory u-boot _ever_ had working network"?
QDrives , 08-27-2024, 12:13 AM
You could ask them...
Robert Feranec , 08-27-2024, 04:48 AM
yes, factory u-boot network works. did you talk to VOIPAC?
LordSurly , 08-27-2024, 03:14 PM
VOIPAC was unable to resolve the issue, though they did suggest that it would work with the baseboard. This seems a bit dubious since the only thing on the REX baseboard vs the board I'm using is the magnetics. Additionally, networking works fine in Linux -- so probably not the hardware.
LordSurly , 08-27-2024, 03:14 PM
Having said that, my colleague is going to ship a baseboard to me to try out.
Robert Feranec , 08-27-2024, 04:47 PM
it is software or network setup or custom baseboard. if your baseboard works under Linux, maybe there still may be a problem ??? (maybe linux can correct if there are is something going randomly wrong with ethernet, did you test the performance of your custom baseboard?). But my biggest suspicion is to double check if the u-boot is really VOIPAC's original u-boot. Can you post the full u-boot boot message here?
LordSurly , 08-27-2024, 05:31 PM
```
U-Boot 2015.04 (Mar 19 2018 - 19:06:26)

CPU: Freescale i.MX6QP rev1.0 at 792 MHz
CPU: Temperature 47 C
Reset cause: POR
Board: MX6 Rex - ultra
I2C: ready
DRAM: 3.8 GiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
SF: Detected SST26VF064B with page size 256 Bytes, erase size 4 KiB, total 8 MiB
In: serial
Out: serial
Err: serial
Net: Phy 3 not found
PHY reset timed out
FEC
Warning: FEC MAC addresses don't match:
Address in SROM is 00:0d:15:01:62:70
Address in environment is 00:0d:15:00:f8:34

Normal Boot
Hit any key to stop autoboot: 0
Rex U-Boot > setenv netdev eth0
Rex U-Boot > setenv ethprime FEC0
Rex U-Boot > setenv ethact FEC0
Rex U-Boot > setenv ethaddr 00:0d:15:00:f8:34
Rex U-Boot > setenv ipaddr 192.168.0.150
Rex U-Boot > setenv serverip 192.168.0.77
Rex U-Boot > setenv gatewayip 192.168.0.1
Rex U-Boot > saveenv
Saving Environment to SPI Flash...
SF: Detected SST26VF064B with page size 256 Bytes, erase size 4 KiB, total 8 MiB
Erasing SPI flash...Writing to SPI flash...done
Rex U-Boot > ping 192.168.0.1
Using FEC device

ARP Retry count exceeded; starting again

ARP Retry count exceeded; starting again

ARP Retry count exceeded; starting again

ARP Retry count exceeded; starting again

Abort
ping failed; host 192.168.0.1 is not alive
```

This is the bootlog I sent to VOIPAC. The command sequence was recommended by VOIPAC support.

I have confirmed that the link is up. I don't see any ARP packets. I've tried direct board-to-NIC and through a switch.
QDrives , 08-27-2024, 08:22 PM
I do not like these messages:
Net: Phy 3 not found
PHY reset timed out
FEC
Warning: FEC MAC addresses don't match:
Address in SROM is 00:0d:15:01:62:70
Address in environment is 00:0d:15:00:f8:34
QDrives , 08-27-2024, 08:23 PM
But have no idea if this is normal.
LordSurly , 08-27-2024, 10:15 PM
I can read/write from FEC
LordSurly , 08-27-2024, 10:18 PM
I've set the `ethaddr` back to `00:0d:15:01:62:70` -- I have no idea why VOIPAC tech support would have me override the MAC address in u-boot. I also read between the lines and setup the network it was physically connected to to match the IPs that he sent, not that it would matter WRT ARP.
Robert Feranec , 08-28-2024, 05:59 AM
what @QDrives pointed out, definitelly doesnt look right. This is how it should look: https://wiki.voipac.com/index.php?title=iMX6_Rex_Basic_U-Boot
Robert Feranec , 08-28-2024, 05:59 AM
Net: FEC [PRIME]
Robert Feranec , 08-28-2024, 06:00 AM
Also, that uboot doesnt look like the latest one from VOIPAC https://github.com/voipac/uboot-imx/commits/uboot-imx-v2015.04/
Robert Feranec , 08-28-2024, 06:04 AM
Your uboot says Mar 19 and it doesnt show repository SHA, hard to say which version it is
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?