Hi Qiang_FSL , raymondwang, igorpadykov YuriMuhin_ng YixingKong fernandolopes lategoodbye GraceH
I am using i.MX28 On-Board Diagnostics Suite (OBDS) to test memory,uart,can,usb etc of my MCIMX28EVK board.
I have followed the commands specified in the pdf available with imx28 OBDS Source.
Since I am using linux , I followed this step
./tools/linux/build_obds.sh
The above command created diag-obds-mx28evk.bin, diag-obds-mx28evk.elf, mx28-obds.sb, ipl files in output/mx28/bin folder.
I have used the steps specified in the pdf to program .sb file to sd card
./tools/windows/cfimager.exe \-f ./output/mx28/bin/mx28-obds.sb \-d g -a
But the command failed.
run-detectors: unable to find an interpreter for ./tools/windows/cfimager.exe
How to load this boot stream image to sd card?
Does the obds test need rootfs image?
Regards
Pt
已解决! 转到解答。
Thanks lategoodbye
Successfully programmed sb file to sd card.
cfimager.exe -f mx28-obds.sb -d <drive to which card reader connected> -a
for example,
it card reader is connected to drive E then
cfimager.exe -f mx28-obds.sb -d g -a
(if you are programming sd for the first time then use -a at the end.)Other wise
cfimager.exe -f mx28-obds.sb -d g
Hi pt.
The OBDS has nothing related to a rootfs or even linux. It is just a simple code that is loaded and runs directly from ram.
If you want to load a .sb image to an sd card on a linux environment, you probably want to use the linux cfimager instead of the windows .exe version!
BR,
Fernando.
I tried mk_mx28 script but its asking for rootfs..I modified the script and flashed stream files to memory card ...but after that when i power on i just get a big hex number..i think its not booting
Then i tried the windows cfimager.exe then i got an error like this how to solve it?
cfimager.exe -f ..\..\output\mx28\bin\mx28-obds.sb -d g -a
Failed to unlock drive, closing anyway!
Error: error -24
Hi Pt,
there are two common pitfalls with cfimager.exe.
1) Please don't use the outdated cfimager version from the ODBS. Take it from the MfgTool.
2) cfimager requires admin privileges. So run the tool always in a admin console.
BR Stefan
Thanks lategoodbye
Successfully programmed sb file to sd card.
cfimager.exe -f mx28-obds.sb -d <drive to which card reader connected> -a
for example,
it card reader is connected to drive E then
cfimager.exe -f mx28-obds.sb -d g -a
(if you are programming sd for the first time then use -a at the end.)Other wise
cfimager.exe -f mx28-obds.sb -d g
Hi Qiang_FSL raymondwang fernandolopes lategoodbye igorpadykov YixingKong
Anyone have spi test code for imx28?
Regards
Pt
The test order in i.MX28 OBDS depends on the linking order of these tests in the ".test_launch" section. To boost a test to run in front of the others, use "RUN_TEST_EARLY" instead of "RUN_TEST" to define the test. If you need to customize the test order to a particular sequence, please modify the main.c.
Hi
I tried to study the code. I didn't understand the flow of the code completely.
The run_tests() function calls these test functions. I have seen that there is three for loop to call test functions.Also I know that its related to linker script. And the RUN_TEST_EARLY function will execute at first. But I didn't understand how to change the order in main.c file. Should I have to define different array for each test ?
Regards
Pt
Please refer to the definition of RUN_TEST macro. It simply declares a static function "obds_##func" and then create a pointer in the ".test_launch" section pointing to this function.
#define RUN_TEST_COMMON(name, func) \
static int obds_##func (void) \
{ \
obds_test_t test_func = (obds_test_t) func; \
record_test_result(name, test_func()); \
return 0; \
}
#define RUN_TEST(name, func) \
RUN_TEST_COMMON(name, func) \
static obds_test_t __obds_test_##func __attribute__ ((used)) __attribute__ ((section(".test_launch"))) = obds_##func;
In run test, every pointer in ".test_launch" section will go though and execute its pointed test function "obds_##func".
To customize the tests in any order, please remove the "static" declaration in RUN_TEST_COMMON() and then call each "obds_##func()" in the order you want.
Hi PeterChan,
Thank you.I understand how to change the order.
I have a doubt on the flow of the code. In the run_tests() function, using for loop we call the functions. The function address is stored in an array.
In the code,
__test_launch_start[], __test_launch_end[] are arrays related to of RUN_TEST function.
static obds_test_t __obds_test_##func __attribute__ ((used)) __attribute__ ((section(".test_launch"))) = obds_##func;
This will allow us to use a special section test_launch.
But how the address is stored in the array? Is that done by linker script? Can you clarify my doubt?
Regards
Pt
Yes, this is done by the linker.
The linker symbols "__test_launch_start" and "__test_launch_end" point to the start and end of the text section ".test_launch". This is the text section where the pointers of "obds_##func" are storing. The order how these pointers are stored in ".test_launch" section relies on the linking order of the source files. You can read mx28/mx28.ld for the detail.
SSP1 is sharing pins with GPMI NAND. To test SSP1, you should NOT run NAND test in OBDS.
The OBDS SD card test is hardcoding the pin mux for SSP0 only. You need to change/add the pin mux for SSP1 in mx28_sd.c.
You can select which SD card slot to test by "char slotNum" in mx28_sd.c.
Hi PeterChan, @chipexpert
Our customized board differ from MCIMX28EVK. We have configure AUART0_CTS and RTS for duart and
ssp1 is used for sd card slot. I am using imx28 obds for testing modules of it. First of all, I am just testing duart only.
So I have commented all other codes.
static void run_tests(void)
{
obds_test_t *test_func;
for (test_func = __test_launch_early_start; test_func < __test_launch_early_end; test_func++)
(*test_func) ();
/* for (test_func = __test_launch_start; test_func < __test_launch_end; test_func++)
(*test_func) ();
for (test_func = __test_launch_late_start; test_func < __test_launch_late_end; test_func++)
(*test_func) (); */
}
To make sd card on ssp1 to start the program, I have changed my bootmode switch according to it. But what else I have to do to make it working?
Regards
Pt
If your board likes our i.MX28 EVK which has a GPIO to gate SD power, you need to blow the OTP fuse HW_OCOTP_ROM0[21:20] SD_POWER_GATE_GPIO to select it. On our EVK, this fuse is not blown and PWM3 is the default power gate for SD0. SD1 boot will not work on our EVK until the HW_OCOTP_ROM0[21:20] fuse is blown for PWM4.
You can use the same OBDS image for both SD0 and SD1 boot,