Hi,
This thread was quite helpful to me in bringing up the external sram up and running in my app spec board, the attached app note I used for making my sram accessible.
did not modified the NVRAM start address of MCF52259EVB - used the same address with different size in Base address mask register. I used following configuration in control,mask and base addr registers for mini flex bus in bsp_init.c...
/* Enable Mini FlexBUS signals (used by external MRAM and CPLD) */ reg_ptr->GPIO.PASPAR = 0x10; reg_ptr->GPIO.PTEPAR = 0xff; reg_ptr->GPIO.PTFPAR = 0xff; reg_ptr->GPIO.PTGPAR = 0xff; reg_ptr->GPIO.PTHPAR = 0x0000; reg_ptr->GPIO.DDRTH = 0xff; reg_ptr->GPIO.PORTTH = 0x00; /* Enable external MRAM mapped on CS0 */ reg_ptr->FB.CSAR0 = 0x10000000; /* CS0 base address */ reg_ptr->FB.CSCR0 = 0x00301780; /* port size = 16 bit, 5- ws, multiplex mode, auto acknowledge enable, address setup - 11*/ reg_ptr->FB.CSMR0 = 0x00010001; /* size 128 kb */
With this initialization and following code I could access the external SRAM I configured
*((unsigned short int *)0x10000000) = 0x1517; *((unsigned short int *)0x10000002) = 0x1518; *((unsigned short int *)0x10000004) = 0x1519; *((unsigned short int *)0x10000006) = 0x151A;
Question - when I try to use _task_create_at or memory pool creation with pointer at this external sram address it gives error.
Error while _task_create_at -> unhandled interrupt
Error while memory pool creation -> memory pool size too small.
using following code for both task creation and memory pool creation
#define DEMOCFG_RTCS_POOL_ADDR (uint_32)(BSP_EXTERNAL_SRAM_BASE)#define DEMOCFG_RTCS_POOL_SIZE 0x000100pointer pt = BSP_EXTERNAL_MRAM_BASE;....................tid = _task_create_at(0, TEST_TASK1, TEST_TASK1_PARAM, pt,TEST_STACK_SIZE);................._RTCS_mem_pool = _mem_create_pool((pointer)DEMOCFG_RTCS_POOL_ADDR, DEMOCFG_RTCS_POOL_SIZE);
Any idea why MQX is giving error in both of the above function calls - is the memory endienness or byte/word access which MQX needs specifically ? I am using here the mux mode in 16 bit memory configurations...
Thanks for your time in reading this long thread and waiting for replies