STM32F407VET6 Black Board freeze

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

STM32F407VET6 Black Board freeze

Post by bellad » Wed Jun 03, 2020 7:53 am

Hello,
with my prog , when i test on the STM32F407VET6 Black Board crashed
i no understand with 192k sram
can you help
thank

Code: Select all

import machine

#thermostats
cchp=machine.Pin('B15', machine.Pin.IN, machine.Pin.PULL_DOWN)
cchf=machine.Pin('B13', machine.Pin.IN, machine.Pin.PULL_DOWN)
ccha=machine.Pin('D13', machine.Pin.IN, machine.Pin.PULL_DOWN)
csdb=machine.Pin('D4', machine.Pin.IN, machine.Pin.PULL_DOWN)
cchv=machine.Pin('D15', machine.Pin.IN, machine.Pin.PULL_DOWN)
cesc=machine.Pin('D1', machine.Pin.IN, machine.Pin.PULL_DOWN)
ccui=machine.Pin('E8', machine.Pin.IN, machine.Pin.PULL_DOWN)
csam=machine.Pin('E10', machine.Pin.IN, machine.Pin.PULL_DOWN)
csal=machine.Pin('E12', machine.Pin.IN, machine.Pin.PULL_DOWN)
cwc=machine.Pin('E14', machine.Pin.IN, machine.Pin.PULL_DOWN)
cbur=machine.Pin('D8', machine.Pin.IN, machine.Pin.PULL_DOWN)
cent=machine.Pin('D10', machine.Pin.IN, machine.Pin.PULL_DOWN)
tcuve=machine.Pin('E0', machine.Pin.IN, machine.Pin.PULL_DOWN)

#fenetres
fchp=machine.Pin('B14', machine.Pin.IN, machine.Pin.PULL_DOWN)
fchf=machine.Pin('B12', machine.Pin.IN, machine.Pin.PULL_DOWN)
fcha=machine.Pin('D7', machine.Pin.IN, machine.Pin.PULL_DOWN)
fsdb=machine.Pin('D5', machine.Pin.IN, machine.Pin.PULL_DOWN)
fchv=machine.Pin('D14', machine.Pin.IN, machine.Pin.PULL_DOWN)
fesc=machine.Pin('D0', machine.Pin.IN, machine.Pin.PULL_DOWN)
fcui=machine.Pin('E7', machine.Pin.IN, machine.Pin.PULL_DOWN)
fsam=machine.Pin('E9', machine.Pin.IN, machine.Pin.PULL_DOWN)
fwc=machine.Pin('E11', machine.Pin.IN, machine.Pin.PULL_DOWN)
fbur=machine.Pin('E13', machine.Pin.IN, machine.Pin.PULL_DOWN)
fent=machine.Pin('E15', machine.Pin.IN, machine.Pin.PULL_DOWN)

#relais
rchp=machine.Pin('E2', machine.Pin.OUT)
rchf=machine.Pin('E5', machine.Pin.OUT)
rcha=machine.Pin('E6', machine.Pin.OUT)
rsdb=machine.Pin('C13', machine.Pin.OUT)
rchv=machine.Pin('C0', machine.Pin.OUT)
resc=machine.Pin('C1', machine.Pin.OUT)
rcui=machine.Pin('C2', machine.Pin.OUT)
rsam=machine.Pin('C3', machine.Pin.OUT)
rsal=machine.Pin('A0', machine.Pin.OUT)
rwc=machine.Pin('A1', machine.Pin.OUT)
rbur=machine.Pin('A2', machine.Pin.OUT)
rent=machine.Pin('A3', machine.Pin.OUT)
rcirc=machine.Pin('A4', machine.Pin.OUT)
rvan=machine.Pin('A5', machine.Pin.OUT)
rchp.value(1)
rchf.value(1)
rcha.value(1)
rsdb.value(1)
rchv.value(1)
resc.value(1)
rcui.value(1)
rsam.value(1)
rsal.value(1)
rwc.value(1)
rbur.value(1)
rent.value(1)
rcirc.value(1)
rvan.value(1)
mchp=0
mchf=0
mcha=0
msdb=0
mchv=0
mesc=0
mcui=0
msma=0
msal=0
mwc=0
mbur=0
ment=0

mem=[mchp,mchf,mcha,msdb,mchv,mesc,mcui,msam,msal,mwc,mbur,ment]
ther=[cchp,cchf,ccha,csdb,cchv,cesc,ccui,csam,csal,cwc,cbur,cent]
fen=[fchp,fchf,fcha,fsdb,fchv,fesc,fcui,fsam,fsam,fwc,fbur,fent]
rel=[rchp,rchf,rcha,rsdb,rchv,resc,rcui,rsam,rsal,rwc,rbur,rent]

print(cchp.value())

User avatar
jcw
Posts: 37
Joined: Sat Dec 21, 2019 12:08 pm
Location: CET/CEST

Re: STM32F407VET6 Black Board freeze

Post by jcw » Wed Jun 03, 2020 8:50 am

There are more reasons for hanging than RAM exhaustion. Perhaps one of those pins you changed is essential for the proper operation of the board? Clock pins, serial I/O pins, USB pins, external flash pins, sd card pins, ...

To debug, remove half your code, try again, etc - until you have isolated the pin(s) that cause(s) this.

bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

Re: STM32F407VET6 Black Board freeze

Post by bellad » Wed Jun 03, 2020 8:58 am

ok , thank i try

bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

Re: STM32F407VET6 Black Board freeze

Post by bellad » Thu Jun 04, 2020 6:48 am

it's

Code: Select all

mem=[mchp,mchf,mcha,msdb,mchv,mesc,mcui,msam,msal,mwc,mbur,ment]
crashed !!!!
I do not understand anything anymore
i need array mem[] with variable ( exp: mchp = 0 or 1 )
it takes a lot of memory ??

i try only :

Code: Select all

mchp=0
mchf=0
mcha=0
msdb=0
mchv=0
mesc=0
mcui=0
msma=0
msal=0
mwc=0
mbur=0
ment=0

mem=[mchp,mchf,mcha,msdb,mchv,mesc,mcui,msam,msal,mwc,mbur,ment]
it's crash

i have to use

Code: Select all

mem=[0,0,0,0,0,0,0,0,0,0,0,0]
But I do not know why

User avatar
jcw
Posts: 37
Joined: Sat Dec 21, 2019 12:08 pm
Location: CET/CEST

Re: STM32F407VET6 Black Board freeze

Post by jcw » Thu Jun 04, 2020 9:00 am

Typo? See the error message at the end:

Code: Select all

$ micropython
MicroPython v1.12-496-ge54626f4c-dirty on 2020-06-04; darwin version
Use Ctrl-D to exit, Ctrl-E for paste mode
>>>
paste mode; Ctrl-C to cancel, Ctrl-D to finish
=== mchp=0
=== mchf=0
=== mcha=0
=== msdb=0
=== mchv=0
=== mesc=0
=== mcui=0
=== msma=0
=== msal=0
=== mwc=0
=== mbur=0
=== ment=0
===
=== mem=[mchp,mchf,mcha,msdb,mchv,mesc,mcui,msam,msal,mwc,mbur,ment]
===
Traceback (most recent call last):
  File "<stdin>", line 14, in <module>
NameError: name 'msam' isn't defined
>>>

bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

Re: STM32F407VET6 Black Board freeze

Post by bellad » Thu Jun 04, 2020 9:14 am

oups , msam not msma , thank you , but for me no error , it crash !!!

OutoftheBOTS_
Posts: 847
Joined: Mon Nov 20, 2017 10:18 am

Re: STM32F407VET6 Black Board freeze

Post by OutoftheBOTS_ » Thu Jun 04, 2020 10:10 pm

I will suspect that 1 of the pin your trying to use is connected to something that is important to the running of the MCU.

Try this commit out every line except the first 1 where you import then uncommit 1 line at a time till you find which line is causing the crash then check the schematic for what is connected to that line.

Post Reply