Why is CCRAM not being used?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
stick
Posts: 13
Joined: Fri Jan 08, 2016 9:17 pm

Why is CCRAM not being used?

Post by stick » Fri Apr 01, 2016 4:41 pm

STM32F405 has RAM (128k) and CCRAM (64k). Currently the linker script for stm32f405.ld does not utilize CCRAM at all.

Why are we not using CCRAM at all? Can we use CCRAM for DATA and BSS (332+27620 bytes) for example (and having full 128k for python runtime)? If not, why?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Why is CCRAM not being used?

Post by dhylands » Fri Apr 01, 2016 4:53 pm

CCRAM is being used as a buffer for the flash filesystem.

Basically, if we use the flash filesystem, we need enough RAM to read in an entire sector. The largest flash sector in the file system is 64K.
https://github.com/micropython/micropyt ... rage.c#L43

User avatar
stick
Posts: 13
Joined: Fri Jan 08, 2016 9:17 pm

Re: Why is CCRAM not being used?

Post by stick » Fri Apr 01, 2016 5:10 pm

Ah, I see. I knew there must be something I am missing out. :-)

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Why is CCRAM not being used?

Post by dhylands » Fri Apr 01, 2016 5:38 pm

There are other boards for which we're probably not using all of the CCRAM, and in those cases there may be ways to take advantage of it. But it isn't seamless, as CCRAM is closely coupled to the processor. For example, you can't DMA to/from CCRAM.

If the CCRAM is contiguous with the regular RAM then it could be made part of the heap, and the DMA code could check the address to see if it can be accessed or not.

So lots of little details to work out.

Post Reply