Tool/software: Code Composer Studio
Hello!
I am working with the C6748 development kit. I am using Code Composer v7 to read from the GPIO pins and store the results in an array. When I try to run my code, I get the error shown below:
[C674X_0] Write error: Invalid File ID (30091) in CIO message!
I have been looking at other posts about this issue and have followed some of the suggestions made, such as increasing the stack and heap size and am putting .sysmem into DDR2 memory. Based on these changes, I feel like I should have more than enough space for the data I'm collecting. I am also using a malloc function for my "array" which I believe should be allocating everything into the heap. I do have one printf statement which I read could cause problems, but I see nothing wrong with it.
My code is below:
/**
* main.c
*/
#include "gpio.h"
#include <stdio.h>
#include "soc_C6748.h"
#include "lcdkC6748.h"
#include "hw_syscfg0_C6748.h"
#include <stdlib.h>
#include "psc.h"
#include "hw_types.h"
#define _SOC_C6748_H_
//#define EMIFA_READ_SETUP_RESETVAL (0x00)
//#define EMIFA_READ_STROBE_RESETVAL (0x00)
//#define EMIFA_READ_HOLD_RESETVAL (0x00)
//#define EMIFA_TA_RESETVAL (0x00)
int main(void)
{
PSCModuleControl(SOC_PSC_1_REGS, HW_PSC_GPIO,
PSC_POWERDOMAIN_ALWAYS_ON,
PSC_MDCTL_NEXT_ENABLE);
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(0)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(1)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(2)) = 0x44444444;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(3)) = 0x44444444;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(4)) = 0x88888844;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(5)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(6)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(7)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(8)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(9)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(10)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(11)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(12)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(13)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(14)) = 0x00000088;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(16)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(17)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(18)) = 0x88888888;
HWREG(SOC_SYSCFG_0_REGS + SYSCFG0_PINMUX(19)) = 0x88888888;
unsigned int i = 0;
for (i = 0; i<= 144; i++){
GPIODirModeSet(SOC_GPIO_0_REGS, i, GPIO_DIR_INPUT);
}
int *data;
data = (int *)malloc(sizeof(int)*2500000);
unsigned int x = 0;
for (x = 0; x<= 2500000; x++){
data[x]=HWREG(SOC_GPIO_0_REGS + GPIO_IN_DATA(2));
}
printf("%d\n",sizeof(data)/sizeof(data[0]));
}
I am fairly new to code composer and the development kit, so I could just be making a silly mistake.
Any help would be appreciated!