Commit 6e0851e7 authored by Hackenberg Stefan (IFAG DSS TI SWP NTV)'s avatar Hackenberg Stefan (IFAG DSS TI SWP NTV)
Browse files

Add openocd for windows

parent 01f8fcf4
......@@ -105,15 +105,21 @@ AlwaysBuild(target_size)
# Target: Upload by default .bin file
#
if 'windows' in sys.platform:
uploader = join('$PIOPLATFORMDIR', 'openocd', 'bin', 'openocd.exe')
else:
uploader = join('$PIOPLATFORMDIR', 'openocd', 'bin', 'openocd')
env.Replace(
PIOPLATFORMDIR=platform.get_dir(),
UPLOADER=join('$PIOPLATFORMDIR', 'openocd', 'bin', 'openocd'),
PIOPLATFORMDIRSLASH=platform.get_dir().replace('\\', '/'),
UPLOADER=uploader,
UPLOADCMD=' '.join([
'$UPLOADER',
'-c "source $PIOPLATFORMDIR/openocd/scripts/interface/kitprog3.cfg"',
'-c "source $PIOPLATFORMDIR/openocd/scripts/target/psoc6_2m.cfg"',
'-c "source $PIOPLATFORMDIRSLASH/openocd/scripts/interface/kitprog3.cfg"',
'-c "source $PIOPLATFORMDIRSLASH/openocd/scripts/target/psoc6_2m.cfg"',
'-c "psoc6 sflash_restrictions 1"',
'-c "program $SOURCE"',
'-c "program {$SOURCE.posix}"',
# '-c "reset_config srst_only;reset run;psoc6.dap dpreg 0x04 0x00;shutdown"',
'-c "shutdown"',
])
......
import os
import sys
from platform import system
......@@ -8,9 +9,12 @@ from platformio.util import get_systype
class Cypress_psoc6Platform(PlatformBase):
def configure_debug_session(self, debug_config):
debug_config.server['executable'] = os.path.join(self.get_dir(), 'openocd', 'bin', 'openocd')
if 'windows' in sys.platform:
debug_config.server['executable'] = os.path.join(self.get_dir(), 'openocd', 'bin', 'openocd.exe')
else:
debug_config.server['executable'] = os.path.join(self.get_dir(), 'openocd', 'bin', 'openocd')
debug_config.server['arguments'] = [
a.replace('$PIOPLATFORMDIR', self.get_dir())
a.replace('$PIOPLATFORMDIR', self.get_dir().replace('\\', '/'))
for a in debug_config.server['arguments']
]
# Avoid piping if debug port is not given explicitly
......@@ -26,7 +30,6 @@ define pio_reset_halt_target
monitor sleep 200
monitor psoc6 reset_halt sysresetreq
monitor gdb_sync
monitor stepi
end
define pio_reset_run_target
......@@ -35,9 +38,9 @@ define pio_reset_run_target
monitor sleep 200
monitor psoc6 reset_halt sysresetreq
monitor gdb_sync
monitor stepi
continue
end
target extended-remote $DEBUG_PORT
pio_reset_halt_target
tbreak main
'''
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment