signal11 / m-stack

Free USB Stack for PIC 16F, 18F, 24F, and 32MX Microcontrollers
http://www.signal11.us/oss/m-stack/
Other
183 stars 94 forks source link

read_short() wrong index for terminating 0 #19

Open limpkin opened 8 years ago

limpkin commented 8 years ago

https://github.com/signal11/m-stack/blob/master/apps/bootloader/software/hex.c#L97

should be changed to chars[4] = '\0';

the indexes 0 1 2 3 will contain the relevant data

signal11 commented 8 years ago

Thanks for the find. There is actually at least one more of those in there I recently found on a derivative project but haven't pushed to master yet. Sorry about that. I'll push them soon.

limpkin commented 8 years ago

you're welcome! no worries... I'm trying to port your bootloader to a PIC24FJ256GB110 but unfortunately the USB doesn't enumerate. Do you know if this has already been done before? Thanks!

signal11 commented 8 years ago

USB not enumerating is almost always because the oscillator is not correct.

Are you using an internal oscillator (not sure if this device supports it for USB)? Some of those PIC24 parts have oscillators that will run at 4 or 8 MHz, and it's not entirely clear in the main oscillator diagram which is used by default and that it can be switched.

limpkin commented 8 years ago

actually it turned out to be a linker script problem! Currently trying to change my linker scripts accordingly.