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

[lpc800 lpc824] do not set sp and pc in reset_and_halt #1445

Merged
merged 1 commit into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions pyocd/target/builtin/target_LPC824M201JHI33.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pyOCD debugger
# Copyright (c) 2006-2013 Arm Limited
# Copyright (c) 2021 Chris Reed
# Copyright (c) 2022 NXP
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -64,13 +65,13 @@ def __init__(self, session):
super(LPC824, self).__init__(session, self.MEMORY_MAP)
self._svd_location = SVDFile.from_builtin("LPC824.xml")

def reset_and_halt(self, reset_type=None, map_to_user=True):
super(LPC824, self).reset_and_halt(reset_type)
# def reset_and_halt(self, reset_type=None, map_to_user=True):
# super(LPC824, self).reset_and_halt(reset_type)

# Remap to use flash and set SP and SP accordingly
if map_to_user:
self.write_memory(0x40048000, 0x2, 32)
sp = self.read_memory(0x0)
pc = self.read_memory(0x4)
self.write_core_register('sp', sp)
self.write_core_register('pc', pc)
# # Remap to use flash and set SP and SP accordingly
# if map_to_user:
# self.write_memory(0x40048000, 0x2, 32)
# sp = self.read_memory(0x0)
# pc = self.read_memory(0x4)
# self.write_core_register('sp', sp)
# self.write_core_register('pc', pc)
19 changes: 10 additions & 9 deletions pyocd/target/builtin/target_lpc800.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pyOCD debugger
# Copyright (c) 2006-2013 Arm Limited
# Copyright (c) 2021 Chris Reed
# Copyright (c) 2022 NXP
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -61,13 +62,13 @@ def __init__(self, session):
super(LPC800, self).__init__(session, self.MEMORY_MAP)
self._svd_location = SVDFile.from_builtin("LPC800_v0.3.svd")

def reset_and_halt(self, reset_type=None, map_to_user=True):
super(LPC800, self).reset_and_halt(reset_type)
# def reset_and_halt(self, reset_type=None, map_to_user=True):
# super(LPC800, self).reset_and_halt(reset_type)

# Remap to use flash and set SP and SP accordingly
if map_to_user:
self.write_memory(0x40048000, 0x2, 32)
sp = self.read_memory(0x0)
pc = self.read_memory(0x4)
self.write_core_register('sp', sp)
self.write_core_register('pc', pc)
# # Remap to use flash and set SP and SP accordingly
# if map_to_user:
# self.write_memory(0x40048000, 0x2, 32)
# sp = self.read_memory(0x0)
# pc = self.read_memory(0x4)
# self.write_core_register('sp', sp)
# self.write_core_register('pc', pc)