Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 00:15 29 Mar 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Armmite F4: programming the firmware

     Page 4 of 16    
Author Message
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 10:11am 29 May 2019
Copy link to clipboard 
Print this post

Yes Peter, It does when powered. Is it possible to read VBAT from within mmbasic?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 10:14am 29 May 2019
Copy link to clipboard 
Print this post

  Quote  s it possible to read VBAT from within mmbasic?


yes: use "pin(BAT)"
 
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 10:33am 29 May 2019
Copy link to clipboard 
Print this post

pin(bat) reads 3.17, which agrees with the multimeter.
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1028
Posted: 11:59am 29 May 2019
Copy link to clipboard 
Print this post

My Power & USB Problems

I hooked my unit up to a HC-12 on Tx & had a number of problems when connected to a USB port with the supplied lead. The unit was locking up or resetting when it triggered the Tx module. I was also having fun with USB connectivity such that it I could start & stop it from MM Chat but no print data was being displayed.

My fault partly lay in the big end of the lead (A type) making seemingly poor connections. (I was blaming the socket on the PC). The small (mini) end seemed OK. There was also a significant voltage drop across the lead.

I changed the lead after reading previous posts & things did improve considerably but I was still having USB problems which were obviously power related.

I couldn't find or see any way of isolating the USB 5V from the rest of the circuit so I took the chance & bridged a proper 5V supply across the appropriate power pins. That made the world of difference with the unit now happily chugging away with no obvious USB problems or it locking up.

I've just got it hooked up to a GPS module on Com4 at the moment displaying time & date & transmitting that. (Getting the GPS to work had me stumped for a good while until I tried another Com port which worked. I then noticed that there was a small error in the pin allocations on one of the lists for Com4 as I mentioned in an earlier post. Worked when the data connection was swapped).

The GPS functions are great. Still so much to learn though.

I just want to add my thanks to Peter & Geoff for all their efforts & to the mighty helpful TBS members for their contributions.
ChopperP
 
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 02:11am 30 May 2019
Copy link to clipboard 
Print this post

I have confirmed the 32.768KHz oscillator is running while the board is powered down using an oscilloscope.
I have tried running from an external 5v supply.
I have re-flashed the chip.
I have checked the soldering of the board.

When i run this with OPTION AUTORUN ON:

CLS
Do
Text 100,100,(Time$),,3
Pause 200
Loop

End


the time always starts with 00:00:02.
I'm running out of clues as to why time$ is always reset.
 
seco61
Senior Member

Joined: 15/06/2011
Location: Australia
Posts: 205
Posted: 02:29am 30 May 2019
Copy link to clipboard 
Print this post

Does DATE$ show the same symptoms?

Silly question, but have you set the date and time?Edited by seco61 2019-05-31

Regards

Gerard (vk3cg/vk3grs)
 
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 03:15am 30 May 2019
Copy link to clipboard 
Print this post

Not a silly question at all.
After a bit of experimentation, including re-flashing i have found...

changing the date to:
02-01-2000
01-02-2000
01-01-2001
does not stop the time and date resetting on power-down

but changing the date to 30-05-2019 makes everything start working!

Also changing the date back to 01-01-2000 does not mess it up again.

Thanks for the question!
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 02:24pm 30 May 2019
Copy link to clipboard 
Print this post

  Quote  but changing the date to 30-05-2019 makes everything start working!


Aaagh: It never occurred to me that you hadn't set a sensible time and date. The firmware looks for a date > 2018 before it allows the clock to run without reset on restart. Otherwise the firmware can't know that the clock has been properly initialised. I'll include this as a warning in the manual
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1983
Posted: 04:20pm 30 May 2019
Copy link to clipboard 
Print this post


"Hoist by your own petard" they call that
 
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 10:24pm 30 May 2019
Copy link to clipboard 
Print this post

I did a bit of searching and found something about a flag called INITS being set when the year is changed in the RTC. I guessed the way a reset happens depends on the state of that flag. I couldn't find any reference to valid year settings. Maybe that is in the MMBasic source. Anyway, on with experimenting. Working on a vibration monitoring system.

Thanks,
David
 
crez

Senior Member

Joined: 24/10/2012
Location: Australia
Posts: 152
Posted: 02:49pm 01 Jun 2019
Copy link to clipboard 
Print this post

Has anyone used the STM CubeProgrammer to upload from an F4? It is a bit unclear to me what memory range you need to faithfully copy with the basic program intact.Edited by crez 2019-06-03
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 04:01pm 01 Jun 2019
Copy link to clipboard 
Print this post

  Quote  It is a bit unclear to me what memory range you need to faithfully copy with the basic program intact.


All of it - sectors 0 to 11 inclusive
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 08:38pm 05 Jun 2019
Copy link to clipboard 
Print this post

My F4s arrived today--6+ weeks after I ordered them. Flashing went successfully, but as was the case for some others, I got no com port in Win10 when plugging in the USB cable after the BT0 and BT1 jumpers were reset. All went well with a CH340 usb/serial and Teraterm connected to Rx and Tx. (This with two different F4s.) Thanks, Peter--Yay!

But I got weirdness after setting OPTION BAUDRATE 115200 and resetting. Numbers and at least some upper case letters print correctly, but the rest are hieroglyphics.

If I type PRINT DATE$ or PRINT TIME$, all is as it should be, but if I type "print date$", the output is correct but the command is mangled. Is this possibly a Teraterm issue? If not, any idea what is happening?


Edited by lizby 2019-06-07
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 09:16pm 05 Jun 2019
Copy link to clipboard 
Print this post

  Quote   I got no com port in Win10 when plugging in the USB cable after the BT0 and BT1 jumpers were reset.


Sounds like you loaded one of the hack versions I posted that were configured for serial console rather than the normal version

  Quote  But I got weirdness after setting OPTION BAUDRATE 115200 and resetting.


This is a standard teraterm issue after it sees a junk character (e.g. at the wrong baudrate). Just close teraterm and re-open and set the new baudrate BEFORE sending it anything
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 11:06pm 05 Jun 2019
Copy link to clipboard 
Print this post

  matherp said  Sounds like you loaded one of the hack versions I posted that were configured for serial console rather than the normal version

Right--I misunderstood, thinking it would do both serial and usb.

  matherp said  This is a standard teraterm issue after it sees a junk character (e.g. at the wrong baudrate). Just close teraterm and re-open and set the new baudrate BEFORE sending it anything

Ah ... OK .. that worked. Thanks.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 12:19am 06 Jun 2019
Copy link to clipboard 
Print this post

Some more issues.

I'm trying to load a file which is 123,356 bytes long (2,998 lines). When I try and xmodem transfer (F11, then in Teraterm, File, Transfer, XMODEM, Send), it freezes without sending anything. Ctrl-C returns the ">" prompt.


If I try copy and paste after F10, it freezes near the end, requiring a reset.

The last hundred line or so are comments. If I copy omitting those and then paste after F10, it goes to completion. SAVE "g7.bas" saves it. I can see it with "FILES".
But if I try to load it, I get an error: "The file/directory object is invalid".



What is happening? (Note--I had the freeze problem on the H7 with F10, copy and paste, but the XMODEM transfer worked--and file LOAD worked.)



PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
erbp
Senior Member

Joined: 03/05/2016
Location: Australia
Posts: 186
Posted: 12:25am 06 Jun 2019
Copy link to clipboard 
Print this post

Hi,

My replacement F4 (see pages 4 & 5 of this thread) arrived on Tuesday - 9 days from ordering! I purchased this one from an EBay vendor and it was around AU$5.00 dearer than the one I originally got from the AliExpress vendor, BUT the AliExpress one took 4 weeks to arrive and I had paid extra for E-Packet delivery, whereas I just took the default free delivery method on the EBay one and it was just 9 days!!!

Even better, the EBay one WORKS!! It also doesn't seems to suffer from the flaky USB connector problem. I just plugged in my USB cable (not the one that comes with the module), and it has a reliable connection - I can even wriggle the cable / connector while in use and all is good.

The replacement one didn't include the battery (vendor's web page had clearly indicated this was the case), so I just took the battery from the dud module and, bingo the RTC works fine too (after setting the current date). Actually I was surprised the original module shipped with the Lithium battery - I didn't think that was legal for stuff sent through the post, but I don't profess to know anything of the regulations in that area (maybe OK because it was fitted in a battery clip?)

Anyway - very impressed with my working F4 and thanks again the Peter firstly for his port of MMBasic to this module and secondly for his assistance while I was trying to figure what was wrong with my original module.

Cheers,
Phil.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 08:22am 06 Jun 2019
Copy link to clipboard 
Print this post

  Quote  I'm trying to load a file which is 123,356 bytes long (2,998 lines). When I try and xmodem transfer (F11, then in Teraterm, File, Transfer, XMODEM, Send), it freezes without sending anything.


Try slowing down the serial port and also try the USB connection. The STM32F4 doesn't have a FIFO on the UART so I suspect it is dropping a character whilst processing
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 02:03pm 06 Jun 2019
Copy link to clipboard 
Print this post

What are SWDIO and SWCLK? Any reason not to use them as ordinary Digital I/Os? Also BOOT1?

And what is the difference between UART and USART?

Edited by lizby 2019-06-08
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 09:42pm 06 Jun 2019
Copy link to clipboard 
Print this post

  Quote  What are SWDIO and SWCLK? Any reason not to use them as ordinary Digital I/Os? Also BOOT1?


No they are all usable PA13, PA14, and PB2 (note they all have a 10k pullups or pulldowns)

Universal
(Synchronous)
Asynchronous
Receiver
Transmitter
 
     Page 4 of 16    
Print this page
© JAQ Software 2024