Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 02:41 05 Jul 2025 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 : CMM2 5.05.06 beta

     Page 9 of 12    
Author Message
djwildstar
Newbie

Joined: 29/07/2020
Location: United States
Posts: 24
Posted: 02:47pm 26 Sep 2020
Copy link to clipboard 
Print this post

@weirdocollector -- Power the CMM2 using a USB A-to-B cable plugged into a USB power supply and the CMM2's USB B port.  Using a keyboard connected to the CMM2's USB A port to issue the UPDATE FIRMWARE command, then unplug the keyboard and plug in the A-to-A data transfer cable.  Once the CMM2 is in firmware update mode, I believe the STM32CubeProgrammer should connect in USB mode (for the A-to-A cable) rather than UART mode (which is used for the A-to-B cable).

Since I made an all-in-one case with the keyboard semi-permanently attached, I've always used the A-to-B cable and the UART programming mode without problems.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 03:35am 27 Sep 2020
Copy link to clipboard 
Print this post

It's not a good idea to power the CMM2 from two different power sourced simultaneously.

You may damage the PC's USB port!

I think this method has not been fully explained in the manual.

I have done it this way:

- Connect the USB A to B cable to the PC.
- Use Teraterm (or Putty) to issue the UPDATE FIRMWARE command.
- Leave the USB A to B cable plugged in and connect the USB A to A cable to a different USB port in the PC.
- The PC will now recognise the USB A to A cable input.
- Use the STM32CubeProgrammer to program the CMM2
- Disconnect both cables to the CMM2.
- Reconnect the power to the CMM2 in your usual fashion.

You may be able to use a USB hub for this but I haven't tried it.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 03:51am 27 Sep 2020
Copy link to clipboard 
Print this post

An alternative method just struck me:

- Power the CMM2 from the PC with the USB A to B cable
- Issue the UPDATEFIRMWARE command with the USB keyboard
- Replace the USB keyboard with the USB A to A cable and plug it into the PC.
- The PC will now recognise the USB A to A cable input.
- Use the STM32CubeProgrammer to program the CMM2

etc.

I have not tried that yet... Next time.

Bill
Keep safe. Live long and prosper.
 
djwildstar
Newbie

Joined: 29/07/2020
Location: United States
Posts: 24
Posted: 06:38pm 28 Sep 2020
Copy link to clipboard 
Print this post

Here's an odd one regarding PRINT and TAB() with commas and semicolons.  It appears that TAB() counts the ASCII TAB character output by a comma as a single character (regardless of the setting of OPTION TAB), while the data actually output to the console is actually 2, 4, or 8 ASCII BLANK characters (depending on the setting of OPTION TAB).  This means that the TAB() function's idea of the current output column will be off by one or more positions depending on the number of non-printable ASCII characters already output on the line.

Here's the test:

> ?"123456789012345678901234567890":?"A B";TAB(20);"C":?"A","B";TAB(20);"C":?"A","B",TAB(20);"C"
123456789012345678901234567890
A B                C
A B                 C
A B                  C


From what I read in the documentation, I would expect the TAB(20) to advance until it reaches position 20, regardless of the mixture of characters printed to the line already.  If this was the case, the three PRINT statements in the example should produce the same output.  The simple work-around for this is to never use the TAB() function with a PRINT statement that will output nonprinting characters (including the comma separator, which outputs ASCII TAB characters).
Edited 2020-09-29 04:39 by djwildstar
 
mclout999
Guru

Joined: 05/07/2020
Location: United States
Posts: 489
Posted: 08:44pm 28 Sep 2020
Copy link to clipboard 
Print this post

Has anyone else seen this behaior? When viewing graphics files in the file brworser, when you hit esc and drop back to the file manager the text is gone but you can see the text if you scrole up and down. I have not noted this befor but I have not used the file manager to view graphic files for many firmware updates so I do not know when this started happening. I am on 50.05.06b9 at the moment.  I am not sure if anyone has mention this here.  I will update to B14 as soon as I can.
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3282
Posted: 10:09pm 28 Sep 2020
Copy link to clipboard 
Print this post

  djwildstar said  Here's an odd one regarding PRINT and TAB() with commas and semicolons.

Thanks.  This is one for me.  I will fix it in the next general update to MMBasic.

Geoff
Geoff Graham - http://geoffg.net
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 377
Posted: 03:44pm 01 Oct 2020
Copy link to clipboard 
Print this post

I am occasionally getting the dreaded "Error: System fault - check code" message when switching video modes.  MM.Info(Reset) is returning "Watchdog"

It seems to happen most often when switching between modes 10,8 or 9,8 to 1,8

I am running V5.05.06b14 on a 400MHz CMM2
-Carl
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10198
Posted: 05:40pm 01 Oct 2020
Copy link to clipboard 
Print this post

Thanks for the report. This suggest the PLL for the display is taking a long time to synch on your processor. I'll put in some more pings of the watchdog if I can find any obvious places that might need them.
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 377
Posted: 06:15pm 01 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  Thanks for the report. This suggest the PLL for the display is taking a long time to synch on your processor. I'll put in some more pings of the watchdog if I can find any obvious places that might need them.


I have the Waveshare boards with the factory crystal resonator installed.  I think their oscillator setup has too much "phase noise" or a slower rise time that leads to less certain timing on the inputs of the PLLs. I also get a lot of "Shimmer" in mode 9

I received my 8MHz oscillator modules, but I haven't had time to install them yet.  I was thinking to install the oscillators on the Waveshare modules to keep them "self contained"
Edited 2020-10-02 04:17 by Sasquatch
-Carl
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1128
Posted: 06:18pm 01 Oct 2020
Copy link to clipboard 
Print this post

I understand the purpose of a watch dog timer. What is the purpose of using it with MMBasic on the CMM2? Is it possible for the user to write a program (in Basic) that could hang the system?
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10198
Posted: 06:25pm 01 Oct 2020
Copy link to clipboard 
Print this post

  Quote  Is it possible for the user to write a program (in Basic) that could hang the system?

Yes- POKE, CSUB
Edited 2020-10-02 04:28 by matherp
 
Sasquatch

Guru

Joined: 08/05/2020
Location: United States
Posts: 377
Posted: 07:00pm 01 Oct 2020
Copy link to clipboard 
Print this post

Just a couple of other quick observations/questions:

The Play Modfile command doesn't seem to support the interrupt at the end of the current file like the other file formats do.  Is there a technical reason or was it just never implemented?

On the File Menu, the <page down> key initially skips down 2 pages instead of to the bottom of the current page.  I know this was changed in the editor recently.  I suppose it's a matter of preference, but my preference would be that the file menu work more like the editor does now.

Thanks again for making this all so easy for the rest of us!
-Carl
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1128
Posted: 05:25am 02 Oct 2020
Copy link to clipboard 
Print this post

I'm seeing a slight issue with drawing sprites. The very bottom right pixel is not being drawn. (Or it is unexpectedly transparent.)

The attached sample program uses mode 3,12 but other modes show this too. The sample PNG is a white box with one red pixel in each corner. The bottom right pixel appears black after:
sprite loadpng 1, "testcube.png"
sprite show 1,151,91,1


TestSprite.zip

Edit: LOAD PNG works as expected and shows the bottom right pixel.
Edited 2020-10-02 15:30 by vegipete
Visit Vegipete's *Mite Library for cool programs.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10198
Posted: 09:07am 02 Oct 2020
Copy link to clipboard 
Print this post

  Quote  I'm seeing a slight issue with drawing sprites. The very bottom right pixel is not being drawn.

I like that sort of bug - 2 minutes to diagnose and fix. Will be in next beta

  Quote  The Play Modfile command doesn't seem to support the interrupt at the end of the current file like the other file formats do.  Is there a technical reason or was it just never implemented?

Mod file playback doesn't end it just loops forever so the concept of a completion interrupt is meaningless

  Quote   my preference would be that the file menu work more like the editor does now.

Agree - will change in next beta

  Quote  I was thinking to install the oscillators on the Waveshare modules to keep them "self contained"



Edited 2020-10-02 19:08 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10198
Posted: 10:07am 02 Oct 2020
Copy link to clipboard 
Print this post

V5.05.06b15 now posted

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

Bug fixes:
Fixed issue where the short form help line is incorrectly shown in editor and filemanager in some high resolution modes.
Fixed bug in SPRITE LOADPNG which misses the last pixel in the png file.
Changes to watchdog to (hopefully) fix any outstanding incorrect triggering

Usability changes:
Page up/down functionality in filemanager now goes to top or end of current display on first press and then pages by the number of lines showing on subsequent presses

Internal changes:
Some internal changes - report any unusual issues

New functionality:
LONGSTRING additions
LONGSTRING SETBYTE data , n 'sets byte n to the value data, n respects OPTION BASE
LONGSTRING RESIZE n 'sets the stored size of a long string to n

Together with LGETBYTE these additions make it easy to use a longstring as a byte array.


DIM a%(100)
LONGSTRING SETBYTE a%(),48,0
LONGSTRING SETBYTE a%(),49,1
LONGSTRING RESIZE a%(),2
LONGSTRING PRINT a%()
PRINT LGETBYTE(a%(),0)
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 11:54am 02 Oct 2020
Copy link to clipboard 
Print this post

BUG (?) with Console {Screen | Serial | Both}

There's probably a good chance I will be told to "stop doing such strange things", but the following is just a short example to reproduce an issue being shown with a longer, perhaps saner, use-case.

Colour Maximite 2
MMBasic Version 5.05.06b14
Copyright 2011-2020 Geoff Graham
Copyright 2016-2020 Peter Mather

> list "console_bug.bas"
For i = 0 To 9
 Option Console Screen
 Print "a";
 Option Console Serial
 Print "b";
 Option Console Both
 Print "c";
Next i

> run "console_bug.bas"
bc


The output to the VGA screen is as expected:
acacacacacacacacacac


Best wishes,

Tom
Edited 2020-10-02 21:54 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10198
Posted: 12:13pm 02 Oct 2020
Copy link to clipboard 
Print this post

I'm in awe of your ability to do the most bizarre things

Try downloading b15 again

PS then tell me what the issue was and how I've fixed it
Edited 2020-10-02 22:36 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 12:36pm 02 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  I'm in awe of your ability to do the most bizarre things

Try downloading b15 again


Thanks Peter, that fixed the "real" problem too.

It wasn't that bizarre, I'm updating the Welcome Tape's menu system and trying to provide centered output using PRINT on both the serial console and the VGA display.

You could argue I should be using TEXT for the VGA display and I may well go that way, but that requires more significant changes to the code.

Thanks again,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10198
Posted: 12:45pm 02 Oct 2020
Copy link to clipboard 
Print this post

  Quote  PS then tell me what the issue was and how I've fixed it


and how you could/should have coded round it
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 12:58pm 02 Oct 2020
Copy link to clipboard 
Print this post

  matherp said  PS then tell me what the issue was and how I've fixed it


With beta 14:
Íøøøøøøøøøøøøþ      Colour Maximite 2 "Welcome Tape"
                                          Version 0.4

                                            CONTENTS

                                 [1] WHAT'S NEW?
                                 [2] Games
                                 [3] Other amusements
                                 [4] Utilities
                                 [5] Demos - Graphics, 3D
                                 [6] Demos - Graphics, Fractals
                                 [7] Demos - Graphics, Sprites
                                 [8] Demos - Graphics, Turtle
                                 [9] Demos - Sound
                                 [A] Demos - CSUBs
                                 [C] Show credits
                                 [Q] Quit

                                Press a key to select an option



With beta 15:



                                Colour Maximite 2 "Welcome Tape"
                                          Version 0.4

                                            CONTENTS

                                 [1] WHAT'S NEW?
                                 [2] Games
                                 [3] Other amusements
                                 [4] Utilities
                                 [5] Demos - Graphics, 3D
                                 [6] Demos - Graphics, Fractals
                                 [7] Demos - Graphics, Sprites
                                 [8] Demos - Graphics, Turtle
                                 [9] Demos - Sound
                                 [A] Demos - CSUBs
                                 [C] Show credits
                                 [Q] Quit

                                Press a key to select an option



  Quote  and how you could/should have coded round it


I'm afraid I don't know, rather lower level than my usual fare. At a guess some unexpected carriage returns or backspaces were being sent, but I'm not sure the output above chimes with that.

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 9 of 12    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025