Page 1 of 1

stm32f4 micropython debug (use arcade as pyboard)

Posted: Fri Jan 03, 2020 8:21 am
by demoCrash
hello,here is the situation:
arcade has a lcd (st7735s) ,and i have make it run in python code, the memory runs wells, here is the code:

Code: Select all

import pyb
import lcd
import gc

while True:
  gc.collect()
  lcd.clearScreen()
  pyb.led_1.toggle()
  lcd.drawText(0,0,"card undetected")
  memstr = 'free: {}'.format(gc.mem_free())
  allocstr = 'alloc: {}'.format(gc.mem_alloc())
  lcd.drawText(0,10,memstr)
  lcd.drawText(0,20,allocstr)
  lcd.show()
  gc.mem_free()
  
but when i plug usb to connect computer,it crashed,and the pybflash can't mount .
so i want to debug the program,after some search, gdb is the answer,then i typed:

Code: Select all

make BOARD=ARCADE_F401RE DEBUG=1
it is overflowed.

Code: Select all

arm-none-eabi-ld: region `FLASH_TEXT' overflowed by 68088 bytes
make: *** [build-ARCADE_F401RE/firmware.elf] Error 1
I did make some configure :

Code: Select all

#define MICROPY_HW_ENABLE_ADC       (0)
#define MICROPY_HW_ENABLE_DAC       (0)
#define MICROPY_HW_ENABLE_CAN       (0)
#define MICROPY_HW_HAS_NEOPIXEL     (0)
#define MICROPY_HW_ENABLE_HW_I2C    (0)
#define MICROPY_PY_PYB_LEGACY (0)
but it still large.

Re: stm32f4 micropython debug (use arcade as pyboard)

Posted: Tue Jan 14, 2020 3:27 am
by demoCrash
I found a solution to the problem.
When SPI DMA starts to send, it may needs to disable all interrupts and start again after the end. :D