Hello,
I'm working with an LPC802, using MCUXpresso IDE and some external scripts relying on PyOcd v0.34.3. I'm connecting to the LPC802 with an MCU-link probe connected through the SWD pins.
The program I've developped works fine when I'm flashing it from MCUXpresso, but doesn't work when flashed with pyOcd. I tried writting the most basic program with pyOcd, but it still fails to work properly. My program :
options={"frequency": 1000000, "target_override": "LPC802", "hide_programming_progress": False}
with ConnectHelper.session_with_chosen_probe(options=options) as session:
target = session.board.target
target.reset_and_halt()
loader = FlashLoader(session, chip_erase="chip")
loader.add_data(0x400, [0xAA,0xBB,0xCC,0xDD])
loader.commit()
I should just be able to write a single word into flash.
After mass erase (pyocd erase --mass -t LPC802), running my script and using pyocd commander (pyocd commander -t LPC802 --connect=pre-reset) to check the value, i can see it's not written properly :
Connected to LPC802 [Halted]:
pyocd> read32 0x400
00000400: 50040a0a
After running my program a second time, the value is finally wirtten properly :
Connected to LPC802 [Halted]:
pyocd> read32 0x400
00000400: ddccbbaa
The intermediate value is not always the same. I'm facing the same issue with other LPC802.
I tried different things, but now I'm clueless on how to keep investigating on this subject. I would really appreciate if you had any idea of what is going on here.
Thank you for your response.