We use a BF537 controller running a recent ADI 3.10 Kernel.
The uboot we use is a bit older: ADI-2009R1-rc3, because it worked fine with our previous kernel.
The UBoot and kernel are stored in a M25P32 STMicro spi-flash.
Normal initialization works fine.
But it happens quite regularly that, using fw_setenv to access the UBoot environment from userspave, the spi flash IC gets locked. That can be confirmed by reading the status registers.
I am able to unlock from userspace using flash_unlock. Or while in the uboot console with the sspi command (by replaying the sequence manually).
The protect function does not seem to work for me.
protect off all gives nothing back. But does not do anything, either (i can check that with an oscilloscope on the data lines). A protect on does the following:
bfin> protect on bank 1
Protect Flash Bank # 1
missing or unknown FLASH type
Is that expected behaviour for an stmicro flash in that firmware version?
I could live with those things if it where not for another issue.
As soon as I deactivate the serial console (silent=1) and try to change something in the uboot environment with a series of commands in the bootcmd than the environment is written incompletely. Luckily it's in a separate sector, but nevertheless my environment is reset to the default, because of a CRC error.
The application is setting the ethaddr variable, which is not accessible through the fw_setenv command.
Is that a known behaviour? Or maybe what I'm doing is completely wrong (see code below)? Some pointers would be highly appreciated.
Code (extract from uboot environment):
lock_flash=sspi 1 8 06;sspi 1 16 011C;sspi 1 8 04
unlock_flash=sspi 1 8 06;sspi 1 16 0100
ulsave=run unlock_flash saveit lock_flash
And the line that kills the environment:
bootcmd=set bootcmd run normalboot;set ethaddr $(my_mac);run ulsave;run normalboot
Adding sleeps in different places did not help, btw. And with an enabled serial port this line works as expected.
Thank you in advance for any input.