pyocd / pyocd/pyOCD

Can not program KW36 Dflash

Open
#687 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.5k
Forks
560
Avg merge
1h 41m
Merged PRs (30d)
3

Description

I have a binary which size is larger than 256kB, so need to program both Pflash and Dflash.
The KW36 memory map is as below image.
image
I try to use pyocd flash command to program my binary with below command:
pyocd flash -b 0251000041114e45002d3007bcf900209e51000097969900 -a 0x00000000 "D:\mcu\wireless_uart_frdmkw.bin"
but it report an error as below:
image

So, I check the flash algo file at pyocd\target\builtin\target_MKW36Z512xxx4.py
and find something is not aligned with MCU user manual, marked as red:
image

I want to fix this issue, so I try to generate flash algo for alisa flash and D flash from FLM files, and modify this target_MKW36Z512xxx4.py script as bolow:
image
I assign different flash algo for Pflahs / alisa Dflash and Dflash from 3 FLMs in Kinetis_KWxx_DFP 1.9.
I try to program this 3 part flash with a small image seperately with different target address, like;
pyocd flash -b 0251000041114e45002d3007bcf900209e51000097969900 -a 0x10000000 "hello.bin
pyocd flash -b 0251000041114e45002d3007bcf900209e51000097969900 -a 0x00004000 "hello.bin
pyocd flash -b 0251000041114e45002d3007bcf900209e51000097969900 -a 0x00000000 "hello.bin
They are all OK in flashing binary progress as below:
image

But when I try to program my big binary(larger than 256kB), it still report an error after a while as below:
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with pyocd/target/builtin/target_MKW36Z512xxx4.py and compare its flash regions with the KW36 memory map and the three FLM files mentioned in the issue. Reproduce the separate small-image commands, then test the larger-than-256kB binary across Pflash and Dflash. Done means the complete binary programs successfully without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.