![]() |
Forum Index : Microcontroller and PC projects : Armmite F4: programming the firmware
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
Yes Peter, It does when powered. Is it possible to read VBAT from within mmbasic? |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
yes: use "pin(BAT)" |
||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
pin(bat) reads 3.17, which agrees with the multimeter. |
||||
Chopperp![]() Guru ![]() Joined: 03/01/2018 Location: AustraliaPosts: 1088 |
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: AustraliaPosts: 152 |
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: AustraliaPosts: 205 |
Does DATE$ show the same symptoms? Silly question, but have you set the date and time? Regards Gerard (vk3cg/vk3grs) |
||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
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 KingdomPosts: 10000 |
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 KingdomPosts: 2137 |
![]() "Hoist by your own petard" they call that |
||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
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: AustraliaPosts: 152 |
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. |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
All of it - sectors 0 to 11 inclusive |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3299 |
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? ![]() PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
Sounds like you loaded one of the hack versions I posted that were configured for serial console rather than the normal version 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 StatesPosts: 3299 |
Right--I misunderstood, thinking it would do both serial and usb. Ah ... OK .. that worked. Thanks. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3299 |
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: AustraliaPosts: 195 |
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!! ![]() ![]() ![]() 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 KingdomPosts: 10000 |
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 StatesPosts: 3299 |
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? PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
No they are all usable PA13, PA14, and PB2 (note they all have a 10k pullups or pulldowns) Universal (Synchronous) Asynchronous Receiver Transmitter |
||||
![]() ![]() ![]() ![]() |
![]() |