Hello,
I have an MQX system running on an MCF52259 with 1MB of SRAM on the FlexBus. I'm running RTCS, the HTTP server, the shell, Mocana's NanoSSH, and a handfull of my own tasks. My question is this: What's the best way for me to off-load some of the RAM usage from the internal RAM to my external SRAM on the FlexBus? I have the external SRAM working, and I know I can set up a LWmem pool and malloc from that (and I am doing so in my own tasks). However, my task's stacks, and all the native MQX stuff (like RTCS and TCP, and whatever else) is doing a very good job filling up the internal 64K.
Is there a good way to move MQX memory useage to the SRAM instead?
Thanks,
Brad
I noticed that you got your mocana SSH running. I haven't been able to get mine going yet.
I dont have any of the common header files. My licence seems to work because I am able to see the bean in PE.
How do you link in the library and where are the header files?
My compiler compains that it can't find moptions.h and a whole lot more files that should be on my computer but I can't find them.
Sorry to trouble you with this Brad but I am desperate!
I had to set two compiler flags to make it like the Mocana code. "-gccincludes" to make the Freescale compiler accept the relative include paths used in the Mocana code, and "-relax_pointers" (I don't remember why).
Getting that Mocana stuff going was not fun. This was only part of the issues I ran into.
I just want to run the demo.
There isn't any instructions on how build the encryption into your project that I can find.
Here is what I have done that doesn't work.
1) Created a stationery project.
2) delete the main.c and include the demo files.
3) add the cau_libv1.1.o
It compains that it cant find the common mocana header files.
I can't find them anywhere on my hard drive.
I'm not sure exactly what you're doing. It doesn't sound like what I was doing.
I'd reccomend contacting Mocana. They were good with providing support to me.
Hello,
Did you ever get an answer to your question Brad? I also use an MCF52259 with external SRAM.
Replies are appreciated,
Juan
Codewarrior 10 Special Edition
Windows XP Pro
MQX 3.6.2
PEMicro USB ColdFire Multilink.
Custom Target based on Coldfire MCF52259.
#define SOCKET_TASK_STACKSIZE 3000void * SOCKET_TASK_STACK; void socket_task_create(){ _task_id task_id; SOCKET_TASK_STACK = mram_alloc(SOCKET_TASK_STACKSIZE); task_id = _task_create_at(0, SOCKET_TASK, 0, SOCKET_TASK_STACK, SOCKET_TASK_STACKSIZE); if (task_id == MQX_NULL_TASK_ID) { _task_block(); }}_mem_pool_id _MRAM_pool_id;void mram_create_pool(){ _MRAM_pool_id = _mem_create_pool(BSP_EXTERNAL_MRAM_RAM_BASE, BSP_EXTERNAL_MRAM_RAM_SIZE); if(_MRAM_pool_id == NULL) { _task_block(); }}pointer mram_alloc(int mem_size){ return _mem_alloc_from(_MRAM_pool_id, mem_size); }
I tried the code snippet you mentioned above. I am however not using the allocated memory for a task but for general mallocs used by my application.
I notice a Hard_fault being triggered though by _lwmem_alloc_internal() when the memory Pool validity is checked. Any pointers on. I would appreciate it if you could help me out.
Thanks
I use the following instruction in the very first line of the first task creted:
_mem_extend( BSP_EXTERNAL_MRAM_RAM_BASE, BSP_EXTERNAL_MRAM_RAM_SIZE );
Teckna
Other method I use to use external MRAM is declare the location of same variables using the linker command file.
.main_application_bss :
{
__START_SBSS = .;
*(.sbss)
*(SCOMMON)
__END_SBSS = .;
__START_BSS = .;
*(.bss)
*(COMMON)
__END_BSS = .;
} >> ram
/* * data.c * * Created on: 15-abr-2011 * Author: Marcos Di Fazio * * Todas las variables globales definidas en este modulo de * compilación van a ir a parar al espacio de memoria de MRAM * Esto se define desde el linker command file. */// Buffer para textos de registros.char scrRegistros_txtBxTextMRAM[1000];