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

an1388-serial, big file, stack smashing detected #51

Open
jaromir-sukuba opened this issue Oct 20, 2018 · 1 comment
Open

an1388-serial, big file, stack smashing detected #51

jaromir-sukuba opened this issue Oct 20, 2018 · 1 comment
Labels
bug in development The topic is currently under development

Comments

@jaromir-sukuba
Copy link

jaromir-sukuba commented Oct 20, 2018

I'm using bootloader from AN1388 via UART, recompiled for PIC32MX370F512H with pic32prog. It works just fine form smaller binaries, though when uploading bigger one, it fails after a few sectors:
./pic32prog -d an1388:/dev/ttyUSB0 uu.hex Programmer for Microchip PIC32 microcontrollers, Version 2.0.203 Copyright: (C) 2011-2015 Serge Vakulenko Adapter: AN1388 UART Bootloader Version 1.0 Program area: 1d000000-1d07ffff Processor: Bootloader Flash memory: 512 kbytes Boot memory: 80 kbytes Data: 394940 bytes Erase: done Program flash: ######*** stack smashing detected ***: ./pic32prog terminated Aborted
I'm not sure whether this is problem with particular hex file, anyway it's available here
https://drive.google.com/file/d/1IIwF2ZsmZSMVRgg39kgh77ERaTWJp21V/view?usp=sharing

I tried running both linux32 and linux64 versions, behaving the same. My OS is Linux Mint 18.3
uname -a Linux plechac 4.15.0-34-generic #37~16.04.1-Ubuntu SMP Tue Aug 28 10:44:06 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

EDIT:
It seems to be related to file size. I disabled a few parts of the firmware to be uploaded, binary is smaller, problem occurs much later in the process:
./pic32prog -d an1388:/dev/ttyUSB0 uu2.hex Programmer for Microchip PIC32 microcontrollers, Version 2.0.203 Copyright: (C) 2011-2015 Serge Vakulenko Adapter: AN1388 UART Bootloader Version 1.0 Program area: 1d000000-1d07ffff Processor: Bootloader Flash memory: 512 kbytes Boot memory: 80 kbytes Data: 263840 bytes Erase: done Program flash: ###############################*** stack smashing detected ***: ./pic32prog terminated Aborted
The smaller file is available here
https://drive.google.com/open?id=1uLhJTTs56mQ4f-1EsiR5ESTBbhxEIhY5

@sergev sergev added bug in development The topic is currently under development labels Oct 21, 2018
@sergev
Copy link
Owner

sergev commented Nov 4, 2018

@jaromir-sukuba Jaromir, can you please try to build pic32prog with -m32 option?
This bug is probably related to 64-bit architecture.
Just add -m32 to CFLAGS in makefile and run "make clean; make".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug in development The topic is currently under development
Projects
None yet
Development

No branches or pull requests

2 participants