Skip to content
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

Environment value didn't get replaced in debug_server #3934

Closed
1 task done
Windmill-City opened this issue Apr 21, 2021 · 4 comments
Closed
1 task done

Environment value didn't get replaced in debug_server #3934

Windmill-City opened this issue Apr 21, 2021 · 4 comments
Assignees
Labels
bug config platformio.ini
Milestone

Comments

@Windmill-City
Copy link

Windmill-City commented Apr 21, 2021

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

Configuration

Operating system:
Windows
PlatformIO Version (platformio --version):
PlatformIO Core, version 5.1.1

Description of problem

I specipic debug_server like this

debug_server = 
    openocd 
    -f $PROJECT_PACKAGES_DIR/packages/tool-openocd/scripts/board/stm32f103zet6_warship.cfg

and get this

embedded:startup.tcl:26: Error: Can't find $PROJECT_PACKAGES_DIR/packages/tool-openocd/scripts/board/stm32f103zet6_warship.cfg

Steps to Reproduce

  1. add above config line
  2. run debug

Actual Results

embedded:startup.tcl:26: Error: Can't find $PROJECT_PACKAGES_DIR/packages/tool-openocd/scripts/board/stm32f103zet6_warship.cfg

Expected Results

successful running debug

If problems with PlatformIO Build System:

The content of platformio.ini:

[env:genericSTM32F103ZE]
platform = ststm32
board = genericSTM32F103ZE
framework = stm32cube
lib_deps = mincrmatt12/STM32Cube [email protected]+f2-1.9.2.2
custom_freertos_config_location = Inc/FreeRTOSConfig.h
extra_scripts = upload_offset_env.py
; Upload Configs
upload_protocol = custom
upload_command = $PROJECT_PACKAGES_DIR/tool-openocd/bin/openocd $UPLOAD_FLAGS
upload_flags =
  -f
  ${platformio.packages_dir}/tool-openocd/scripts/board/stm32f103zet6_warship.cfg
  -c
  program .pio/build/genericSTM32F103ZE/firmware.bin $UPLOAD_OFFSET verify reset exit
; Debug Configs
debug_tool = custom
debug_server = 
    openocd 
    -f
    ${platformio.packages_dir}/tool-openocd/scripts/board/stm32f103zet6_warship.cfg
[platformio]
include_dir = Inc
src_dir = Src

Source file to reproduce issue:
it has successful built

Additional info

@ivankravets ivankravets added this to the 5.2.0 milestone Apr 21, 2021
@ivankravets ivankravets self-assigned this Apr 21, 2021
@ivankravets ivankravets removed this from the 5.2.0 milestone Apr 24, 2021
@ivankravets ivankravets added this to the 5.2.0 milestone Apr 24, 2021
@ivankravets
Copy link
Member

Could you try to replace $PROJECT_PACKAGES_DIR with ${platformio.packages_dir}? If it works for you, we will update our docs. See the other configuration variables https://docs.platformio.org/en/latest/projectconf/section_platformio.html

@Windmill-City
Copy link
Author

Windmill-City commented Apr 25, 2021

Could you try to replace $PROJECT_PACKAGES_DIR with ${platformio.packages_dir}? If it works for you, we will update our docs. See the other configuration variables https://docs.platformio.org/en/latest/projectconf/section_platformio.html

; Debug Configs
debug_tool = custom
debug_server = 
    openocd 
    -f
    ${platformio.packages_dir}/tool-openocd/scripts/board/stm32f103zet6_warship.cfg
Processing genericSTM32F103ZE (platform: ststm32; board: genericSTM32F103ZE; framework: stm32cube)
--------------------------------------------------------------------------------
Reading symbols from E:\Codes\MCU\VSCode_MCU_Develop\.pio\build\genericSTM32F103ZE\firmware.elf...
done.
PlatformIO Unified Debugger -> http://bit.ly/pio-debug
PlatformIO: debug_tool = custom
PlatformIO: Initializing remote target...
Open On-Chip Debugger 0.10.0 (2021-03-01) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
libusb1 09e75e98b4d9ea7909e8837b7a3f00dda4589dc3
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
embedded:startup.tcl:26: Error: Can't find $PROJECT_CORE_DIR/packages/tool-openocd/scripts/board/stm32f103zet6_warship.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 26

Still failing

@Windmill-City
Copy link
Author

Windmill-City commented Apr 25, 2021

I success starting debugger by following

; Debug Configs
debug_tool = custom
debug_server = 
    openocd 
    -f
    ${platformio.core_dir}/packages/tool-openocd/scripts/board/stm32f103zet6_warship.cfg

@ivankravets ivankravets added config platformio.ini and removed docs labels Apr 28, 2021
@ivankravets ivankravets modified the milestones: 5.2.0, 5.2.1 Sep 13, 2021
@ivankravets ivankravets modified the milestones: 5.2.1, 5.2.2 Oct 11, 2021
@ivankravets
Copy link
Member

Thanks for the report! Please re-test with pio upgrade --dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug config platformio.ini
Projects
None yet
Development

No branches or pull requests

2 participants