Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:37 01 Aug 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: Is there a memory map ?

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 10:49pm 15 Mar 2021
Copy link to clipboard 
Print this post

... there doesn't seem to be one in the manual.

Given that poke-ing in the wrong place is liable to cause the CMM2 to hang I'd like to put some protection in SPForth so that it can't perform store operations to such addresses.

Best wishes,

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

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 07:39am 16 Mar 2021
Copy link to clipboard 
Print this post

Look at a .map file / linker script / read the ST doc?

(I'd expect anything in a manual to be along the lines of "reserved for use by MMBasic" or "may change in future releases".)

John
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 09:49am 16 Mar 2021
Copy link to clipboard 
Print this post

Thanks for the well deserved RTFM John

I'll be honest I'm lazy and if there is a possiblity that someone will point me to the correct FM and the appropriate page then I will almost always ask first.

Also I'm a desktop application developer and I struggle to read the data sheet for a 4000 series CMOS chip so the ST documentation is probably not a great place for me to start. Probably best if I just poke around in the CMM2 firmware as I believe I have seen it display some sort of POKE protection.

Best wishes,

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

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 10:10am 16 Mar 2021
Copy link to clipboard 
Print this post

In memedit (which is really just a peek/poke frontend) I defined the following ranges:

'--> Mapped address ranges: Can be referenced in goto command.
CONST SRAM% = &H38000000
CONST SRAM_END% = &H38010000 - 256

CONST RAM1% = &H30000000
CONST RAM1_END% = &H30040000 - 256

CONST RAM2% = &H40000000
CONST RAM2_END% = &H59000000

CONST AXI_RAM% =     &H24000000
CONST AXI_RAM_END% = &H24080000

CONST ROM1% = &H08000000
CONST ROM1_END% = &H08200000
CONST ROM2% = &H10000000
CONST ROM2_END% = &H20000000
'<--
Epsilon CMM2 projects
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 02:10pm 16 Mar 2021
Copy link to clipboard 
Print this post

Thanks @epsilon, that looks like the information I need.

where did you get these from ?
and would you briefly expand on what each range is for ?

Best wishes,

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

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 03:06pm 16 Mar 2021
Copy link to clipboard 
Print this post

The bulk of it came from our resident oracle Peter Maher of course:

https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=12887#156351

The stm32h743ii datasheet has a great block diagram. Docs can be found here:
https://www.st.com/en/microcontrollers-microprocessors/stm32h743ii.html#

Also very helpful is a copy of the CMM2 FW source code. The comments in there combined with the datasheet block diagram give good info about the different memory regions.

Now I'm a bit confused about whether I'm allowed to post here info that I learned directly from the FW source code, so I guess I shouldn't until someone can clear that up for me.
The FW source code has comments describing the meaning of the different memory regions.
Epsilon CMM2 projects
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 03:39pm 16 Mar 2021
Copy link to clipboard 
Print this post

Thanks for the links @epsilon and "no worries" regarding the FW as I have access to the source code. Now I have some hints on where to look I will do so for myself.

Best wishes,

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

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3292
Posted: 01:55am 17 Mar 2021
Copy link to clipboard 
Print this post

  epsilon said  Now I'm a bit confused about whether I'm allowed to post here info that I learned directly from the FW source code, so I guess I shouldn't until someone can clear that up for me.

Please feel free to post.

We (or more properly I) don't want the whole source code openly published because in the past that encouraged forks and alternate versions which caused confusion and trouble for the user base.  But excerpts (or any other info) is fine.

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

Senior Member

Joined: 30/07/2020
Location: Belgium
Posts: 255
Posted: 08:54am 17 Mar 2021
Copy link to clipboard 
Print this post

  Geoffg said  We (or more properly I) don't want the whole source code openly published because in the past that encouraged forks and alternate versions which caused confusion and trouble for the user base.  But excerpts (or any other info) is fine.


Thank you for clearing that up, Geoff.

So, in that case, this is the info I was referring to:

*
#define D1_AXISRAM_BASE           (0x24000000UL) /*!< Base address of : (up to 512KB) system data RAM accessible over over AXI                */

AXI-SRAM is embedded SRAM

*
#define PERIPH_BASE               (0x40000000UL) /*!< Base address of : AHB/APB Peripherals

This is memory-mapped peripheral space

*
#define D2_AHBSRAM_BASE           (0x30000000UL) /*!< Base address of : (up to 288KB) system data RAM accessible over over AXI->AHB Bridge    */
#define D3_SRAM_BASE              (0x38000000UL) /*!< Base address of : Backup SRAM(64 KB) over AXI->AHB Bridge  

More SRAMs in other 'domains' of the chip. Domains are power management domains, i.e. areas that can be powered-up / down / put in standby separate from the other domains in the chip.

*
#define D1_AXIFLASH_BASE          (0x08000000UL) /*!< Base address of : (up to 2 MB) embedded FLASH memory accessible over AXI
#define D2_AXISRAM_BASE           (0x10000000UL) /*!< Base address of : (up to 288KB) system data RAM accessible over over AXI

AXI, AHB and APB are the different buses used internally by ARM. AXI is the main bus, AHB is a bit more limited/older, and APB is for peripherals.

Now that I'm looking at it, I noticed that two important ranges are missing:
* 0xd0000000-0xd2000000: SDRAM: External memory, accessed through the FMC memory contoller
* 0x38800000-0x38801000: Backup-SRAM. Backup SRAM retains data in low power mode

Note that there are more RAMs, e.g. ITCM and DTCM, Tightly Coupled Memories with very low-latency access, but those are not made accessible to MMBasic. The FW reserves this memory for itself, for performance-critical work.
Epsilon CMM2 projects
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 12:13pm 18 Mar 2021
Copy link to clipboard 
Print this post

  epsilon said  So, in that case, this is the info I was referring to:


Thanks @epsilon, I still don't know what most of that means but hopefully I will in time.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
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