build_debug.sh

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

build_debug.sh

28,873 次查看
usala
Contributor III

Re-opening this issue since I didn't get any results from the last individual handling it.

See: https://community.nxp.com/t5/i-MX-Processors/build-debug-sh/m-p/1415502#M187151

I am trying to build Eval IMMXRT1176 Ethernet AVB demo as build_debug.sh and I get the following error: `itcm' overflowed by 55880 bytes.  See attached log.  What can I do to fix this issue.  I do need the debug version.  See attached NXP instruction manual on how to duplicate the environment.

Best regards,

Ulises

 

0 项奖励
回复
19 回复数

28,857 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Sorry for replying late.
Actually, I don't encounter the build issue after following the
NXP_GenAVB_TSN_MCUXpresso_User_s_Guide_3_3_rev1, you can see that I can generate the image.

jeremyzhou_0-1646125106813.png

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,853 次查看
usala
Contributor III

Jeremy you are building the tsn app and using build_release.sh.  You need to build avb_audio_app using ./build_debug.sh.  See attached file showing the path to the avb_audio_app project.

Best regards,

Ulises

0 项奖励
回复

28,840 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi @usala ,
Sorry for replying late.
Now I basic replicate the issue, I guess it's related to the linker file and it needs to use the SDRAM as the primary RAM.

jeremyzhou_0-1646289954854.png

jeremyzhou_0-1646292940503.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,832 次查看
usala
Contributor III

Jeremy,

Thank you.

Ulises

0 项奖励
回复

28,810 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi @usala ,
Thanks for your reply.
After digging deeper, I work it out finially and please modify the linker file (~\genavb-apps-freertos-3_3_5\boards\evkmimxrt1170\demo_apps\avb_tsn\common\armgcc\MIMXRT1176xxxxx_cm7.ld) as the below figure shows.

jeremyzhou_0-1646386089534.png

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,798 次查看
usala
Contributor III

Hi Jeremy,

I made the change to the linker file and now it builds but the code is not running.  I use SEGGER's Ozone to download the image as I have been doing for the build_release.sh but the debug image is not running.  There is no print output to the shell terminal.  Is there something else I need to do to get it to run?

Best regards,

Ulises

0 项奖励
回复

28,603 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi @usala 

Could you please share me the Ozone preject? The issue is maybe caused by a in-correct init sdram, so please check that if there is a Jlink-script be called when do the debug, maybe named evkmimxrt1170_connect_cm4_cm7side.jlinkscript, this one is used to init the sdram before run the code. 

      And also, in order to validate this, you can also change the boot option to the QSPI FLASH, and then debug the project with Ozone. If the hard-fault gone, we can verify that we need to add the evkmimxrt1170_connect_cm4_cm7side.jlinkscript into the Ozone project.

     So please have a try first with the boot from the QSPI flash(0 0 1 0), then try to add the evkmimxrt1170_connect_cm4_cm7side.jlinkscript into the Ozone project.

BR,

Jeremy

0 项奖励
回复

28,593 次查看
usala
Contributor III

Hi Jeremy,

I am not using a jlink script file perhaps that is part of the problem and if so can you help me set one up.  Attached is my project file for your viewing.

Best regards,

Ulises

0 项奖励
回复

28,577 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi @usala ,
Please have a try on the attached Ozone-project.
Note( I am using the Jlink-v7.60b, and the Ozone v3.10g, to make sure there are no errors on the version, please re-configure the project before debugging the code):
1. Select the chips by clicking tools->J-Link Settings, then select our chip, mine is MIMXRT1176xxxA_M7:

crist_xu_0-1647943023902.pngcrist_xu_1-1647943083341.png
2. Edit the IMXRT_1176.jdebug, and change the elf file to your path:

crist_xu_2-1647943183407.png
3. change the reset-type to Reset & Halt

jeremyzhou_0-1648000768711.png

We can debug our code then.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,571 次查看
usala
Contributor III

Hi Jeremy,

I didn't receive any attachments from you.  I hope you were referring to making changes to the original attachment I sent to you of my Ozone project.  I tried your suggested changes and I am still getting the hard fault.  My setup is as follows.

Ozone version V3.23 (Beta) 2021-06-14.  This was the latest version at the time I installed it. I will get the same as your version and try it.

J-Link version 10.1.  This is the version that came with the J_Link adapter and I don't know if it can be changed.

The code jumps to the function static void BusFault(uint32_t stack[]) in application_util.c and stays in the for(;;) loop indefinitely.

0 项奖励
回复

28,569 次查看
usala
Contributor III

Hi Jeremy,

I have upgraded J-Link  to v7.60b and Ozone to v3.26c.  Ozone does not give you the option to pick it's download version as J-Link does.  I tried these with your suggested project file changes and I still get the hard fault but with more details than in the previous version.  I have enclosed the error log details as well as the new project file.

----------------------------------------------------------------------------------------------

The target stopped in HardFault exception state.

Reason: A fault with configurable priority has been escalated to a HardFault exception at 0x0000CADA.

For more information about analyzing faults on Cortex-M, refer to:

https://wiki.segger.com/Cortex-M_Fault.

Best regards,

Ulises

0 项奖励
回复

28,557 次查看
usala
Contributor III

Hi Jeremy,

I am building the debug version using build_debug.sh.   I I make the changes you have suggested and I build release it does not hard fault and I am able to set breakpoints in the disassemble window of Ozone.  This is okay but ideally I will like to debug the c source code with the build_debug.sh.

Best regards,

Ulises

0 项奖励
回复

28,757 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi @usala 

Sorry for replying late.
1) Is there something else I need to do to get it to run?
-- It needs a bit weird, whether you ever try to program the generated boot image to the MIMXRT1170 EVK after clicking the build_release.sh.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,754 次查看
usala
Contributor III

Hi Jeremy,

You need to connect the MIMXRT1176 eval to a terminal program like Tera-term on to the USB port next to the NXP logo on the PCB. 115200 BAUD to see the actual logs from the firmware running.  After you build the build_debug.sh follow the steps in the manual on how to upload the build image onto the eval board.  You need to set the dip switch to bootloader mode and them drop the bin file onto the pop up window generated by the boot loader.  See 9.8. Flashing an image section on "NXP_GenAVB_TSN_MCUXpresso_User_s_Guide_3_3_rev1.pdf".  If you build the build_release.sh the image produced will run normally and you'll see the logs on the terminal program, however if you build the build_debug.sh nothing is displayed on the terminal program as if not running at all.  this is the issue.

Best regards,

Ulises

0 项奖励
回复

28,712 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Please comment out the below code lines in the startup_MIMXRT1176_cm7.S to avoid the FlexRAM assignment changes, then give it a try again.

 /*
     * FlexRAM setup
     * Needs to be done before any usage of TCM memory.
     * DTCM  = 320 KB
     * ITCM  = 192 KB
     * OCRAM = 0 KB
     * Bank low  7   -  0
     *           DDDDDDDD
     * Bank high 15  -  8
     *           DDIIIIII
     */
    ; .equ    GPR17, 0x400E4044
    ; .equ    GPR18, 0x400E4048
    ; .equ    BANKCFGLOW, 0xAAAA
    ; .equ    BANKCFGHIGH, 0xAFFF
    ; .equ    MASK, 0xFFFF0000

    ; ldr     r0, =GPR17
    ; ldr     r1, [r0]
    ; ldr     r2, =MASK
    ; and     r1, r2
    ; ldr     r2, =BANKCFGLOW
    ; orr     r1, r2
    ; str     r1, [r0]

    ; ldr     r0, =GPR18
    ; ldr     r1, [r0]
    ; ldr     r2, =MASK
    ; and     r1, r2
    ; ldr     r2, =BANKCFGHIGH
    ; orr     r1, r2
    ; str     r1, [r0]

    ; /* ARM core ITCM/DTCM total size setup */
    ; /* Set ITCM/DTCM size to maximum supported, matching MPU mapping */
    ; .equ    GPR16, 0x400E4040
    ; .equ    TCMCFG, 0xAA07

    ; ldr     r0, =GPR16
    ; ldr     r1, [r0]
    ; mov     r2, #0xFFFF00FF
    ; and     r1, r2
    ; ldr     r2, =TCMCFG
    ; orr     r1, r2
    ; str     r1, [r0]


BR,
Jeremy
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,707 次查看
usala
Contributor III

Hi Jeremy,

 

I commented out the code as you suggested and still nothing is been output to the shell terminal.  Attached is a renamed startup_MIMXRT1176_cm7.txt for your review.

   

Best regards,

Ulises

0 项奖励
回复

28,739 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi @usala ,

Thanks for your clarification and I'll give it a test later.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 项奖励
回复

28,652 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,
Sorry for the reply late and the AE team suggests you follow below steps to fix the issue.
1) Add two MACRO into the CMakeFiles to enable the SDRAM at the boot time.

jeremyzhou_0-1647424662672.png


2) Replace the old ld file with the attachment.3) After that, rebuild the project with either build_debug.sh or build_release.sh for testing.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

28,620 次查看
usala
Contributor III

Hi Jeremy,

I added the 2 lines to CMakeList.txt (see attached files) and replace 

MIMXRT1176xxxxx_cm7.7z file with the one you enclosed and here are the results.  I build_debug and use SEGGER Ozone to upload the .elf image onto the target.  After the image loads with the JLink connected and run debug it immediately goes to the hard fault handler.  I attached captures of the console and image of the Ozone screen for your viewing.  The good news is that resetting the target the debug image runs okay standalone.  The hard fault happens only if try to debug using Ozone attached via JLink and what I am really looking for is to be able to debug the code.  Let me know what else you want me to try or any additional information you need. Best regards, Ulises
 
 
 
 
 
 
 
 

 

Best regards,

Ulises

 
0 项奖励
回复