[U-Boot] Issues developing standalone applications

Hi, I am new to U-Boot and I am trying to develop a standalone application that accesses my board peripherals. I couldn't find any examples on how to access my NAND device, for example, and when trying to run the same sequence that is made in the board's initialization, I get an ** Illegal Instruction ** error, causing the board to reboot. I know it's an issue on the NAND initialization, but I am neither very familiar to the U-Boot code nor to debugging errors. What follows is the console output I get when trying to run nand_init_chip() from my standalone application:
NIP: 3FFDB098 XER: 20000000 LR: 00046170 REGS: 3bf4f528 TRAP: 0700 DAR: 00000000 MSR: 00029200 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00
** Illegal Instruction ** Call backtrace: 65782035 000465EC 00046668 00046764 3FF6F548 3FF6F5C8 3FF7FE44 3FF8001C 3FF62A74 3FF61630 Program Check Exception
I need to run a badblocks test on the NAND device, and I successfully do it in the board initialization from within the U-Boot environment, but not from the standalone environment.
I could really use some examples, but I couldn't find any online.
Thank you so much for your attention, Lucas Pereira Endres.

Dear Lucas Endres,
In message CAKZOPtKY-WJsZf_PpoC4gV_8Y8PvHSGJm4hhah2Znq=rvGMYxQ@mail.gmail.com you wrote:
I know it's an issue on the NAND initialization, but I am neither very familiar to the U-Boot code nor to debugging errors. What follows is the console output I get when trying to run nand_init_chip() from my standalone application:
You are not supposed to do things like that. For standalone applications, ther eis only a very limited, well-defined set of functionality exported by U-Boot. NAND access is not part of it.
I need to run a badblocks test on the NAND device, and I successfully do it in the board initialization from within the U-Boot environment, but not from the standalone environment.
Why do you want to do it from a standalone application?
Best regards,
Wolfgang Denk
participants (2)
-
Lucas Endres
-
Wolfgang Denk