Skip to content

The scripts (debug, debugserver and flash) are not working for Intel S1000 board #7986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rgundi opened this issue May 29, 2018 · 6 comments
Closed
Assignees
Labels
area: Flashing bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug

Comments

@rgundi
Copy link
Contributor

rgundi commented May 29, 2018

This was working before. Looks like the commit bc7b1c5 regressed it.

@nashif nashif added bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug labels May 29, 2018
mbolivar pushed a commit to mbolivar/zephyr that referenced this issue May 31, 2018
The runner argument backend currently no longer accepts setting common
configuration values through board_runner_args() and
board_finalize_runner_args().

This is affecting the intel_s1000 board's CMake configuration, causing
errors when 'west flash' et al are run.

However, the options in board_finalize_runner_args() appear to be
unnecessary (and likely shouldn't be there at all), as they are just
hard-coding the same values set elsewhere in the build system.

Let's have a single point of truth and remove them from the board
file. This has the side effect of restoring 'make flash'.

Fixes: zephyrproject-rtos#7986

Signed-off-by: Marti Bolivar <[email protected]>
@mbolivar
Copy link
Contributor

@rgundi the surface cause of the issue is that the flasher has internally moved the "common" configuration values like the board directory, kernel elf, etc. away from what you can set with board_finalize_runner_args(). I think this is not the root cause of the issue.

I took a look at boards/common/intel_s1000_crb.board.cmake (by the way, this entire file should just be inlined into boards/xtensa/intel_s1000_crb/board.cmake, since there is nothing "common" about its contents).

I see some suspicious lines that appear to be the real root cause, rather than the west changes:

https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/common/intel_s1000_crb.board.cmake

Specifically:

  • setting --board-dir would have no effect even if it worked, since it's being set to the default value
  • ditto for --kernel-elf, and that's hard-coding something that is already configured elsewhere by the build system
  • as far as I can tell, ditto for --gdb, the file appears to be taking the existing setting already set in gcc.cmake (since xcc.cmake sets COMPILER to gcc)

Since I can't build for your board as it does not have a publicly available toolchain, I am just guessing here.

I have submitted a PR that I think fixes these issues (#8076); could you please test?

Thanks!

@rgundi
Copy link
Contributor Author

rgundi commented Jun 1, 2018

@mbolivar .. As you have already figured out by now, I have fixed the runner related changes in #7988. However, i can do debugserver, debug and flash successfully only if i revert the commit bc7b1c5.

@mbolivar
Copy link
Contributor

mbolivar commented Jun 1, 2018

@rgundi I see. Thanks for your work locating this commit as a problem.

Do you have some more details, since I can't run this without the board and access to the toolchain?

Output from these commands (when run from your build directory) would be useful:

west -vvv flash
west -vvv debug
west -vvv debugserver

@nashif
Copy link
Member

nashif commented Jun 5, 2018

@rgundi can you please provide the requested information? @sathishkuttan can you help with this as well?

@nashif nashif added priority: low Low impact/importance bug and removed priority: medium Medium impact/importance bug labels Jun 5, 2018
@rgundi
Copy link
Contributor Author

rgundi commented Jun 6, 2018

@mbolivar .. below is the output from these commands.


**west -vvv debugserver:**
Re-building /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
Build command list: ['/usr/bin/cmake', '--build', '/home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build']
As command: /usr/bin/cmake --build /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
[  1%] Built target kobj_types_h_target
[  2%] Generating always_rebuild
Building for board intel_s1000_crb
[  3%] Generating misc/generated/syscalls.json
[  4%] Built target syscall_list_h_target
[  5%] Built target syscall_macros_h_target
[  6%] Built target driver_validation_h_target
[  8%] Built target offsets
[  9%] Built target offsets_h
[ 24%] Built target app
[ 53%] Built target zephyr
[ 76%] Built target kernel
[ 77%] Built target linker_script
[ 78%] Built target arch__xtensa__soc__intel_s1000
[ 82%] Built target arch__xtensa__core__startup
[ 84%] Built target subsys__usb__class__hid
[ 86%] Built target drivers__dma
[ 88%] Built target drivers__gpio
[ 90%] Built target drivers__i2c
[ 91%] Built target drivers__i2s
[ 93%] Built target drivers__serial
[ 95%] Built target zephyr_prebuilt
[ 95%] Built target linker_pass_final_script
[100%] Built target kernel_elf
Using runner: intel_s1000
Intel S1000 GDB server running on port 20000
/opt/Tensilica/xocd-12.0.4/xt-ocd -c /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml -I /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
Topology file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml
Init file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
XOCD 12.0.4
(c) 1999-2018 Tensilica Inc. All rights reserved.
[Debug Log 2018-06-06 15:19:59]

Loading module "gdbstub" v2.0.0.11
Loading module "ft2232" v2.0.1.0
Loading module "jtag" v2.0.0.20
Loading module "xtensa" v2.0.0.40
 Total IR bits : 8
  TAP[0] irwidth = 8
 Total DR bypass bits : 1
WARNING 5.20: Chain Controller0: Bypass DR method finds 1 TAPs while topology file sets 2
WARNING 5.21: Chain Controller0: Capture IR method finds 1 TAPs while topology file sets 2
WARNING 5.22:          Topology file has non-Xtensa devices. Capture IR method is not reliable here.
WARNING 5.23: Chain Controller0, Tap TAP0: IR Width differs, Topology sets 5, Capture IR got 8
WARNING 5.22:          Topology file has non-Xtensa devices. Capture IR method is not reliable here.
WARNING 5.23: Chain Controller0, Tap TAP2: IR Width differs, Topology sets 8, Capture IR got 0
WARNING 5.22:          Topology file has non-Xtensa devices. Capture IR method is not reliable here.
Execute JTAG TAPs initialization script:
 TAP Reset
 Scan IR (len:  8) 12 > JTAG > 1
 Scan DR (len:  6) 0 > JTAG > 0
 Scan IR (len:  8) 12 > JTAG > 1
 Scan DR (len:  6) 1 > JTAG > 0
Starting thread 'GDBStub0'
0: Failed to check IR (0x1f)

Run the debugserver command again as it always fails for the first time **west -vvv debugserver:** Please note that, originally (without this patchset), when debugserver is executed, internally the command is run twice.
Re-building /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
Build command list: ['/usr/bin/cmake', '--build', '/home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build']
As command: /usr/bin/cmake --build /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
[  1%] Built target kobj_types_h_target
[  2%] Generating always_rebuild
Building for board intel_s1000_crb
[  3%] Generating misc/generated/syscalls.json
[  4%] Built target syscall_list_h_target
[  5%] Built target syscall_macros_h_target
[  6%] Built target driver_validation_h_target
[  8%] Built target offsets
[  9%] Built target offsets_h
[ 24%] Built target app
[ 53%] Built target zephyr
[ 76%] Built target kernel
[ 77%] Built target linker_script
[ 78%] Built target arch__xtensa__soc__intel_s1000
[ 82%] Built target arch__xtensa__core__startup
[ 84%] Built target subsys__usb__class__hid
[ 86%] Built target drivers__dma
[ 88%] Built target drivers__gpio
[ 90%] Built target drivers__i2c
[ 91%] Built target drivers__i2s
[ 93%] Built target drivers__serial
[ 95%] Built target zephyr_prebuilt
[ 95%] Built target linker_pass_final_script
[100%] Built target kernel_elf
Using runner: intel_s1000
Intel S1000 GDB server running on port 20000
/opt/Tensilica/xocd-12.0.4/xt-ocd -c /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml -I /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
Topology file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml
Init file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
XOCD 12.0.4
(c) 1999-2018 Tensilica Inc. All rights reserved.
[Debug Log 2018-06-06 15:21:17]

Loading module "gdbstub" v2.0.0.11
Loading module "ft2232" v2.0.1.0
Loading module "jtag" v2.0.0.20
Loading module "xtensa" v2.0.0.40
 Total IR bits : 13
  TAP[0] irwidth = 5
  TAP[1] irwidth = 8
 Total DR bypass bits : 2
Execute JTAG TAPs initialization script:
 TAP Reset
 Scan IR (len:  8) 12 > JTAG > 21
 Scan DR (len:  6) 0 > JTAG > 2
 Scan IR (len:  8) 12 > JTAG > 1
 Scan DR (len:  6) 1 > JTAG > 0
Starting thread 'GDBStub0'
0: Warning: Ignoring IDCODE from topology file

**west -vvv debug:** It gets stuck in the debugserver and the debug command is never executed.
Re-building /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
Build command list: ['/usr/bin/cmake', '--build', '/home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build']
As command: /usr/bin/cmake --build /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
[  1%] Built target kobj_types_h_target
[  2%] Generating always_rebuild
Building for board intel_s1000_crb
[  3%] Generating misc/generated/syscalls.json
[  4%] Built target syscall_list_h_target
[  5%] Built target syscall_macros_h_target
[  6%] Built target driver_validation_h_target
[  8%] Built target offsets
[  9%] Built target offsets_h
[ 24%] Built target app
[ 53%] Built target zephyr
[ 76%] Built target kernel
[ 77%] Built target linker_script
[ 78%] Built target arch__xtensa__soc__intel_s1000
[ 82%] Built target arch__xtensa__core__startup
[ 84%] Built target subsys__usb__class__hid
[ 86%] Built target drivers__dma
[ 88%] Built target drivers__gpio
[ 90%] Built target drivers__i2c
[ 91%] Built target drivers__i2s
[ 93%] Built target drivers__serial
[ 95%] Built target zephyr_prebuilt
[ 95%] Built target linker_pass_final_script
[100%] Built target kernel_elf
Using runner: intel_s1000
Intel S1000 GDB server running on port 20000
/opt/Tensilica/xocd-12.0.4/xt-ocd -c /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml -I /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
Topology file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml
Init file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
XOCD 12.0.4
(c) 1999-2018 Tensilica Inc. All rights reserved.
[Debug Log 2018-06-06 15:28:12]

Loading module "gdbstub" v2.0.0.11
Loading module "ft2232" v2.0.1.0
Loading module "jtag" v2.0.0.20
Loading module "xtensa" v2.0.0.40
 Total IR bits : 13
  TAP[0] irwidth = 5
  TAP[1] irwidth = 8
 Total DR bypass bits : 2
Execute JTAG TAPs initialization script:
 TAP Reset
 Scan IR (len:  8) 12 > JTAG > 21
 Scan DR (len:  6) 0 > JTAG > 2
 Scan IR (len:  8) 12 > JTAG > 1
 Scan DR (len:  6) 1 > JTAG > 0
Starting thread 'GDBStub0'
0: Warning: Ignoring IDCODE from topology file

**west -vvv flash:** It gets stuck in the debugserver and the debug command is never executed.
Re-building /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
Build command list: ['/usr/bin/cmake', '--build', '/home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build']
As command: /usr/bin/cmake --build /home/rgundi/RajZephyr/zephyr/tests/boards/intel_s1000_crb/build
[  1%] Built target kobj_types_h_target
[  2%] Generating always_rebuild
Building for board intel_s1000_crb
[  3%] Generating misc/generated/syscalls.json
[  4%] Built target syscall_list_h_target
[  5%] Built target syscall_macros_h_target
[  6%] Built target driver_validation_h_target
[  8%] Built target offsets
[  9%] Built target offsets_h
[ 24%] Built target app
[ 53%] Built target zephyr
[ 76%] Built target kernel
[ 77%] Built target linker_script
[ 78%] Built target arch__xtensa__soc__intel_s1000
[ 82%] Built target arch__xtensa__core__startup
[ 84%] Built target subsys__usb__class__hid
[ 86%] Built target drivers__dma
[ 88%] Built target drivers__gpio
[ 90%] Built target drivers__i2c
[ 91%] Built target drivers__i2s
[ 93%] Built target drivers__serial
[ 95%] Built target zephyr_prebuilt
[ 95%] Built target linker_pass_final_script
[100%] Built target kernel_elf
Using runner: intel_s1000
Intel S1000 GDB server running on port 20000
/opt/Tensilica/xocd-12.0.4/xt-ocd -c /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml -I /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
Topology file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/topology_dsp0_flyswatter2.xml
Init file /home/rgundi/RajZephyr/zephyr/boards/xtensa/intel_s1000_crb/support/dsp0_gdb.txt
XOCD 12.0.4
(c) 1999-2018 Tensilica Inc. All rights reserved.
[Debug Log 2018-06-06 15:29:26]

Loading module "gdbstub" v2.0.0.11
Loading module "ft2232" v2.0.1.0
Loading module "jtag" v2.0.0.20
Loading module "xtensa" v2.0.0.40
 Total IR bits : 13
  TAP[0] irwidth = 5
  TAP[1] irwidth = 8
 Total DR bypass bits : 2
Execute JTAG TAPs initialization script:
 TAP Reset
 Scan IR (len:  8) 12 > JTAG > 21
 Scan DR (len:  6) 0 > JTAG > 2
 Scan IR (len:  8) 12 > JTAG > 1
 Scan DR (len:  6) 1 > JTAG > 0
Starting thread 'GDBStub0'
0: Warning: Ignoring IDCODE from topology file

@nashif nashif added priority: medium Medium impact/importance bug area: Flashing and removed priority: low Low impact/importance bug labels Oct 5, 2018
@nashif
Copy link
Member

nashif commented Feb 10, 2019

this actually works, but I would not call this flashing, the script needs to be adapted to do flashing over USB which this is supported. Closing this for now.

@nashif nashif closed this as completed Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flashing bug The issue is a bug, or the PR is fixing a bug priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants