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

PIC32MZ2048ECM100 programming issue. #6

Open
jaromir-sukuba opened this issue May 13, 2015 · 2 comments
Open

PIC32MZ2048ECM100 programming issue. #6

jaromir-sukuba opened this issue May 13, 2015 · 2 comments

Comments

@jaromir-sukuba
Copy link

Hello.

Seems like there is a problem with PIC32MZ2048ECM100 on a custom board and PicKit2 programmer. The board works as expected, when programmed with PicKit3 or ICD3 programmers via MPLAB X.

Running the pic32prog with no arguments results in normal PIC detection http://pastebin.com/qdTfMZ8C However, running with -v and hex filename results in verification error and the FLASH content memory is untouched.

There is already binary programmed by PicKit3 and MPLAB X. When I try to burn the same hex file using pic32prog, it doesn't fail at verification.
To me it looks like the the FLASH isn't erased and programmed, though reading back works, as it fails at verification.
Both the scenarios are captured here http://pastebin.com/prumgfQj

I'm running it on Ubuntu 14.04, pulled the latest revison, built with no problems.

Any ideas about this one?

@sergev
Copy link
Owner

sergev commented May 14, 2015

Hi Jaromir,

Thank you for detailed bug report.

Generally, pic32prog worked fine for me with PICkit2 when programming pic32mz microcontrollers. I use it to program a bootloader for SDZL board, and LiteBSD kernel for MZ Starter Kit board. This issue might be related to Flash bank switching or something. Or may your hex file has something which confuses pic32prog. Can you please send me your hex file, so I could try to reproduce the issue?

@jaromir-sukuba
Copy link
Author

Oh, never mind, I sorted it out after writing another detailed bug report, moment before sending it.
Problem was on my side. As I was reading the wiki here https://github.com/sergev/pic32prog/wiki I thought that -v option enables verification after programming.

I took a look at sources https://github.com/sergev/pic32prog/blob/master/pic32prog.c#L737-L767 to find the real meaning of switches.
So, lesson learned:

  • running with no switches performs erasing, programming and verification,
  • -v switch enables ONLY verification against binary file (that's what I was doing and thought it is actually programming)
  • -S disables verification (only erasing and programming is performed) and
  • -h prints actually helpful help message

Honestly, the wiki documentation is slightly confusing, at least for me - it made me think that -v switch is optional step after programming. I think this issue can be closed, but I'd suggest make clarification in wiki.

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

No branches or pull requests

2 participants