i.MX28 On-Board Diagnostics Suite (OBDS)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX28 On-Board Diagnostics Suite (OBDS)

Jump to solution
5,030 Views
pt
Senior Contributor I

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

Labels (2)
1 Solution
2,844 Views
pt
Senior Contributor I

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

View solution in original post

0 Kudos
27 Replies
2,422 Views
fernandolopes
Contributor III

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.



0 Kudos
2,422 Views
pt
Senior Contributor I

Hi fernandolopes

The  linux cfimager is missing in imx_28_obds_release_v1_0 . I have searched for it ,but only windows cfimager is available.

Regards

Pt

0 Kudos
2,422 Views
fernandolopes
Contributor III

Indeed there is no linux cfimager with the obds package.

To be used on linux there is a script named mk_mx28_sd.

My copy is attached. I got it from the i.MX28 SDK (L2.6.35_10.12.01_SDK) on the folder L2.6.35_10.12.01_SDK_scripts.

Best regards,

Fernando.

0 Kudos
2,422 Views
pt
Senior Contributor I

Hi fernandolopes

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

0 Kudos
2,422 Views
lategoodbye
Senior Contributor I

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

2,845 Views
pt
Senior Contributor I

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

0 Kudos
2,422 Views
pt
Senior Contributor I

Hi Qiang_FSL raymondwang fernandolopes lategoodbye igorpadykov YixingKong

Anyone have spi test code for imx28?

Regards

Pt

0 Kudos
2,422 Views
jimmychan
NXP TechSupport
NXP TechSupport

I think you can take the spi test in the imx-test package for reference. (to extract the source code , you can type this LTIB command ./ltib -p imx-test -m prep)

2,422 Views
pt
Senior Contributor I

Hi Qiang_FSL

I want to  change the order of test functions in OBDS tool suite. How could I do that?

Regards

Pt

0 Kudos
2,422 Views
PeterChan
NXP Employee
NXP Employee

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.

2,422 Views
pt
Senior Contributor I

Hi

Thanks . "RUN_TEST_EARLY" will make that test to run at first. I understood that.

But I do not know how to change the order. Please help.

Regards

Pt

0 Kudos
2,422 Views
PeterChan
NXP Employee
NXP Employee

Please modify main.c to run each test in the order you want.

0 Kudos
2,422 Views
pt
Senior Contributor I

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

0 Kudos
2,422 Views
PeterChan
NXP Employee
NXP Employee

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.

2,422 Views
pt
Senior Contributor I

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

0 Kudos
2,420 Views
PeterChan
NXP Employee
NXP Employee

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.

2,419 Views
pt
Senior Contributor I

Hi PeterChan

In our customized board of imx28, we are using sd1(ssp1), so what change should I have to do in the imx obds tool suit to work on it?

Regards

Parvathy

0 Kudos
2,419 Views
PeterChan
NXP Employee
NXP Employee

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.

2,419 Views
pt
Senior Contributor I

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

0 Kudos
2,419 Views
PeterChan
NXP Employee
NXP Employee

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,

0 Kudos