Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:28 13 Nov 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 : Setting a default "OPTION" when compiling MMBASIC

Author Message
MustardMan

Senior Member

Joined: 30/08/2019
Location: Australia
Posts: 175
Posted: 11:22am 01 Oct 2019
Copy link to clipboard 
Print this post

Hi,

I am about to recompile MM-BASIC to make some customisations to the source code, and I would like to alter the default "OPTIONs" that the device starts new-born with. For example, I wish to have my device already have "OPTION KEYBOARD US", "OPTION LCDPANEL CONSOLE" and "OPTION LCDPANEL SSD1963_5 ..." configured.

It is not a big issue, but I expect to compile MM-BASIC multiple times to get my customisations working, and I don't want to hassle with USB-ing to a PC every single time to set up exactly the same thing time and time again.

Where in the source code (using the "MicromiteSource.zip") is where I can set my default OPTIONs? I am having great trouble finding it/them.

Cheers,
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 11:30am 01 Oct 2019
Copy link to clipboard 
Print this post

Instead of a re-compile, take a virging MM, make the changes you like then read the flash back into your IDE and save it as your standard build MMBasic

I think the options are included - the basic program is
 
MustardMan

Senior Member

Joined: 30/08/2019
Location: Australia
Posts: 175
Posted: 11:56am 01 Oct 2019
Copy link to clipboard 
Print this post

Thanks for the reply.

My intent is to make some changes to the LCD "SSD1963_5" code, but that will likely take me several attempts to get it right.

From what you say, I should read just the flash where the options are stored (after setting my option parameters) and write it back after re-flashing the MM-BASIC code itself...? I'll have to check out the memory map (if there is one) that shows the separation of the MM-BASIC firmware and where the OPTIONs are stored. I thought they were in the same block, but...

Cheers,
Edited 2019-10-01 21:59 by MustardMan
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 01:43pm 01 Oct 2019
Copy link to clipboard 
Print this post

Get a virgin MM, make your changes (even upload a prog too if you like, with stuff in the library etc...) then just read back the entire memory image and save it as a HEX file. No need to hack the memory to bits - just snag the whole lot - basic prog will become part of the HEX image too, options, everything.

this then becomes your customised build.

Take a look at the section "Single, Secure HEX File" on page 16 of the Micromite User Manual.

I think this will probably do what you want without all the pain of a recompile.
Edited 2019-10-01 23:56 by CaptainBoing
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10573
Posted: 05:59pm 01 Oct 2019
Copy link to clipboard 
Print this post

  Quote  Where in the source code (using the "MicromiteSource.zip") is where I can set my default OPTIONs? I am having great trouble finding it/them.


flash.c
 
MustardMan

Senior Member

Joined: 30/08/2019
Location: Australia
Posts: 175
Posted: 09:05pm 01 Oct 2019
Copy link to clipboard 
Print this post

@CaptainBoing
Thanks for the suggestion & your assistance, but I will need to recompile because I want to make changes to the BASIC interpreter itself. I could possibly write a Cfunction to do what I want, but my changes are a long way down (as in almost at the base level - altering one or more of the defines/constants in "SSD1963.c" to use a different screen SSD1963 with 'super wide' 800x320 LCD panel ). The changes have nothing to do with the BASIC program that sits on top.

@matherp
Thanks for the pointer - I found a map of how the flash memory is used, but sadly no hint on where the OPTIONs get stored. Perhaps I'll have to trace a particular OPTION and find out where it gets put...

Cheers,
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025