using objdump on design studio concil

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

using objdump on design studio concil

Jump to solution
3,539 Views
hajianik
Senior Contributor I

Hi,

How do I use objdump  command on S32 Design studio?

MY TARGET IS s32k144/146.

What do I need to type in the council?

Thanks,

0 Kudos
Reply
1 Solution
3,228 Views
hajianik
Senior Contributor I

Hi Jiri,

The issue is resolved. It was actually a hardware problem the input that was keeping the device awake was . routed to the wrong pin on the 146 eval board and for reasons that I'm yet to know it was working one way and not the other. The micro was going to sleep basically.

Thanks for keeping up with me on this.

View solution in original post

0 Kudos
Reply
15 Replies
3,228 Views
hajianik
Senior Contributor I

Hi Jiri,

Unfortunately, I'm pressed for time, I won't be able to do that. Actually I don't believe you need a slave SPI device for this . This happens when I try to write to the slave device, so you should be able to reproduce the anomaly .  If you use the scope you can see the CLK, CHIP_SELECT, MOSI, MISO , in this case you don't care about MISO since you don't have  a slave device.

ONE THING I FORGOT TO MENTION IS THAT TO PREVENT THE BOARD TO GO TO SLEEP, YOU NEED TO CONNECT VDD TO PTA2 ON YOUR EVAL BOARD

Thanks, 

0 Kudos
Reply
3,228 Views
jiri_kral
NXP Employee
NXP Employee

Hi

S32DS uses standard GNU objdump. Here is list of options: 

GNU Binary Utilities: objdump 

For what purpose you need to use objdump? You can add objdump in post-build step, or use it out of S32DS from command line. 

Jiri

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Hi Jiri,

you wrote:

or use it out of S32DS from command line. 

where is S32DS from command line?

is it in the debug council? or do you mean like the windows command line?

Thanks

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Actually I know how to use it now.

Do you know which option would be best to use to indicate a memory access violation?

Thanks

0 Kudos
Reply
3,228 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

which kind of memory access violation? If you like to see addresses used in .elf file - you can disassembly your .elf file in project. Just right click on .elf file in binaries folder and choose disassembly selected files.

pastedImage_1.png

Also the mapfile - located in the Debug folder of your project - project_name.map file is good starting point to look for out of range memory address. 

From standard windows command line you can use:

arm-none-eabi-objdump.exe -d your_elf_file.elf

Don't forget add the [S32DS_INSTALL_PATH]\Cross_Tools\gcc-arm-none-eabi-4_9\bin\ into system variable PATH if you like to use objdump across filesystem. 

Jiri 

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Hi Kral,

I guess I need to use something like  gdb core dump to be able to detect a segfault.

I am not sure how to use it on S32k design studio or even if it could be used here.I know I hit a trap however with limited call stack in design studio it is hard to pinpoint it.

Thanks

0 Kudos
Reply
3,228 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

Well - I'm afraid that S32K144 has no such resources to be able generate something like core dump. The best way how to debug your program is just go step by step with breakpoints. 

If you use FreeRTOS - it is more complicated, but FreeRTOS has some techniques for heap monitoring and so on. 

So - can you be please more specific what you are trying to do? 

Jiri

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Hi Jiri,

Thanks for your reply.

To be more specific:

I do a SPI DMA transfer using SDK DMA_TRANSFER routine. This function takes SPI instance, pointer to TX buffer and a pointer to RX_buffer and the number of the bytes to be transferred as inputs

I use the SPI complete call back to call this routine to avoid bottle neck since I don't want to wait to trigger the next transfer(NONE BLOCKING).

It works fine as long as I pass the RX_BUFFER pointer where it is declared as a global variable in the file where the transfer_complete call back is defined. if I declare it in some other file and refer to it as external where it is used ,It trips an exception. The issue is that I don't know which exception is triggered.

All the exceptions are defined as a while(1) That's where I end up.

There is no build error and MAP file looks good . the bss section has the right alignment.

If I want to reach here , I would say may be the DMA works on certain areas of the RAM and not all the section defined in the linker file.

I just hope my description is not too confusing to understand.

Thanks,  

0 Kudos
Reply
3,228 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

finally - I understand. So, are you able in debug session check if the addresses passed into SDK dma_transfer are valid addresses? You can also check memory content on that particular address in memory view: 

pastedImage_1.png

But the exception may be caused by bunch of other things - like watchdog, unhandled interrupt and so on. Can you share your project?

Jiri

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Hi Jiri,

The Exception is a data bus fault.

the variable in question are defined in i2cee.c, i2cee.h and lspi_master_driver.c and it is called "rx_1_buff[35].

if declared as global in "lspi_master_driver.c" everything works if not (defined in i2cee.c/.h) I hit a bus fault.

I'VE ATTACHED THE PROJECT. THIS IS A HUGE PROJECT.

capture_bus_error.PNG

0 Kudos
Reply
3,228 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

unfortunately I can't reproduce your issue (probably because I don't have valid SPI communication). But the question is - why you define the rx_1_buff in i2cee.c where is not used at all and the buffer is used as extern in lspi_master_driver.c - and this is the only place where is used. 

You also don't need to initialize the buffer to 0. It is done by startup.

Well, if buffer defined in lspi_master_driver.c is working for you - why you need define it in different .c file? 

Also if the error occurs - the Program Counter should hold address of instruction which caused bus error. 

Jiri

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Hi,

of course, I don't have to and when I don't it works as I've mentioned that before. the i2cee.c file will be changed to SPIee.c and this strictly is based on the way things are done around this place.

I already pinpointed the instruction address.

I LOOKED AT THE STACK AND PC POINTS TO 0X18055 WHICH THIS BEING A THUMB INSTRUCTION SET, ACTUALLY IT MEANS 0X18054 WHICH IS "MOV R3,R0 " AND the following would be "strh r3 [r7, #30] .

I need to dig deeper into this.

The question is why this is happening . I can get around this ,this time by changing where I define a certain variable .

If we don't find the root cause of this now, next time it could bite us in the rear bottom.

Thanks,

0 Kudos
Reply
3,228 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

agree. For me it is interesting stuff and I like to find out the root case. it will be helpful if you can find scenario which caused the bus error, but without special settings. I can setup two EVB for testing, but I don't know if I can just send dummy data back from slave EVB. If you have time for that, can you prepare such scenario? 

Jiri 

0 Kudos
Reply
3,229 Views
hajianik
Senior Contributor I

Hi Jiri,

The issue is resolved. It was actually a hardware problem the input that was keeping the device awake was . routed to the wrong pin on the 146 eval board and for reasons that I'm yet to know it was working one way and not the other. The micro was going to sleep basically.

Thanks for keeping up with me on this.

0 Kudos
Reply
3,228 Views
hajianik
Senior Contributor I

Hi Jiri,

Unfortunately, I'm pressed for time, I won't be able to do that. Actually I don't believe you need a slave SPI device for this . This happens when I try to write to the slave device, so you should be able to reproduce the anomaly .  If you use the scope you can see the CLK, CHIP_SELECT, MOSI, MISO , in this case you don't care about MISO since you don't have  a slave device.

ONE THING I FORGOT TO MENTION IS THAT TO PREVENT THE BOARD TO GO TO SLEEP, YOU NEED TO CONNECT VDD TO PTA2 ON YOUR EVAL BOARD

Thanks, 

0 Kudos
Reply