FLASH_ISR overflow

144 views
Skip to first unread message

Erik B Beall

unread,
Dec 26, 2014, 11:45:22 PM12/26/14
to open...@googlegroups.com
I've been trying to add a python submodule and in the last linking command it fails. I've made the module based on the mlx90620 submodule (code is inside omv/py, modded Makefiles, hooks added to omv/main.c, micropython/stmhal/qstrdefsport.h and micropython/stmhal/mpconfigport.h), The code has functions to init/deinit/read/write a 16-bit SPI interface. However, it overflows the ISR part of FLASH (first 16KB). I've been removing little bits of other code to see if that allows it to fit, but with no success so far. I didn't think these would take up so much room in the ISR region, is there something I'm missing? I'm using the gcc-arm-none-eabi=4.8.4.2014q3-0trusty11 ARM version of gcc. Here are the last four lines of "make" in the src/ subdirectory:

arm-none-eabi-cpp -P -E -DOPENMV1 omv/stm32f4xx.ld.S > /home/ebeall/openmv/src/build/stm32f4xx.lds
arm-none-eabi-gcc -mcpu=cortex-m4 -mabi=aapcs-linux -mthumb -mlittle-endian -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostdlib -Wl,--gc-sections -Wl,-T/home/ebeall/openmv/src/build/stm32f4xx.lds <ALL THE COMPILED BITS> -o /home/ebeall/openmv/src/build/openmv.elf
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: /home/ebeall/openmv/src/build/openmv.elf section `.isr_vector' will not fit in region `FLASH_ISR'
/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: region `FLASH_ISR' overflowed by 92 bytes

For a test, I changed the ISR_LENGTH to 17KB in omv/stm32f4xx.ld.S and it links/compiles fine, but from what I've read (https://github.com/micropython/micropython/issues/69) it sounds like 16KB for ISR is a hard limit? Does anybody know what I'm doing wrong?

Michael Shimniok

unread,
Dec 26, 2014, 11:58:12 PM12/26/14
to open...@googlegroups.com
interesting. I ran into the same problem today but was trying to compile for f429. I will have to undo changes and retry. 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "Openmvcam" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmvcam+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
Visit this group at http://groups.google.com/group/openmvcam.
To view this discussion on the web visit https://groups.google.com/d/msgid/openmvcam/7f9a622b-11cc-4b88-ad94-8693e4800001%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ibrahim Abdelkader

unread,
Dec 27, 2014, 7:34:37 AM12/27/14
to open...@googlegroups.com
Just remove object files from the ISR section, I was trying to fit as much code as I can into the ISR section, to save flash, you won't need to do that with 1/2MBs flash, you can remove all *.o from the ISR if you want (except the ISR of course).

Erik B Beall

unread,
Dec 27, 2014, 10:36:01 PM12/27/14
to open...@googlegroups.com
Ah, I see. Done, and compiles fine. Thanks Ibrahim!

Michael Shimniok

unread,
Jan 2, 2015, 1:28:15 PM1/2/15
to open...@googlegroups.com
On 12/27/2014 08:36 PM, Erik B Beall wrote:
Ah, I see. Done, and compiles fine. Thanks Ibrahim!
Same here; compiles fine at that point but in my case there's a problem with execution on my omv3 board (STM32F429VIT6). After flashing and power cycle, the device doesn't show up on lsusb and the LED isn't blinking. Without a debugger I have no idea what's going on. :/  Your hardware working, Erik?

--
You received this message because you are subscribed to the Google Groups "Openmvcam" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openmvcam+...@googlegroups.com.
To post to this group, send email to open...@googlegroups.com.
Visit this group at http://groups.google.com/group/openmvcam.

For more options, visit https://groups.google.com/d/optout.

Erik B Beall

unread,
Jan 3, 2015, 12:17:47 AM1/3/15
to open...@googlegroups.com
Yeah, its working fine, but its the regular 407-based OpenMV1 I built. I'm building an OpenMV2 tomorrow morning and will let you know how it goes. 

Erik B Beall

unread,
Jan 3, 2015, 11:30:32 PM1/3/15
to open...@googlegroups.com
I'm able to get the STM32 bootloader visible when I short BOOT to VCC, and loaded the code built for OpenMV2 (with the changes mentioned in this thread), but when rebooting, I don't get a USB device. The lights go into __fatal_error() when plugging in, so omv/main.c is executing (I can change the LED flash sequence, reflash, and observe the change). Tomorrow I'll do some debugging using the LED sequence to figure out which call to __fatal_error() it is.

Steve Gulick

unread,
Jan 24, 2015, 7:54:03 PM1/24/15
to open...@googlegroups.com
I'm also having trouble with the FLASH_ISR overflow by 92 bytes.
Can someone post a working stm32f4xx.ld.S file? I have been trying to modify it but without luck
Thanks!

Erik B Beall

unread,
Jan 25, 2015, 10:17:21 AM1/25/15
to open...@googlegroups.com
Remove lines 90 and 91:
    */ff.o(.text*)
    */ccsbcs.o(.text*)
And you should be able to fit it. The code will just go in the non-ISR regions, Ibrahim did this to save space as best as possible.

Steve Gulick

unread,
Jan 25, 2015, 6:02:55 PM1/25/15
to open...@googlegroups.com
Thanks, Erik - that worked fine!
Reply all
Reply to author
Forward
0 new messages