Differences between real HW and simulator


Specs say that Pokitto has 36 kb RAM and 256 kb program memory. I suppose the latter is the memory where Pokitto system SW will be flashed to (?).

I suppose that when making changes to system SW, and use static memory allocation in C++, that would not consume RAM? Only dynamic memory allocations use RAM (e.g. malloc and stack)? Btw. what is the size of the stack in Pokitto HW

What part of the PokittoSim -project code is HW dependent and HW independent? This is what I think:
HW independent:

    HW (simulator) dependent:
  • The POKITTO_SIM folder and
  • “*SIM” files under POKITTO_LIBS (e.g. FileIO_SIM.cpp)
  • SDL2

You are correct in all counts.

To make sure your data is placed in the read-only flash memory, simply use const keyword as in:

const char buffer[2000];

Ok, good.

How about the stack size in real HW?

1 Like

Thats where you need to be most careful. The mbed online compiler has a default setting for this and you should stay within that. I do not remember it offhand but I’ll check it and get back asap.

Dynamic memory allocation is possible and as you probably know its heap + pointer to heap on stack. So stack size is not easily the limiting factor.

Of course, the stack in PC sim is not comparable in a meaningful way to the HW stack. Just do not allocate / use outrageous RAM buffers like 64k and you’ll be mostly OK