Hi,
Is the code something which is similar to the mentioned below such that in order to save the GPIO data at the internal memory location :-
int main()
{
/* initial instruction is important to use the shadow area */
uint32_t *var __attribute__((at(0x10080000)));
LPC_CREG->M4MEMMAP = 0x1C000000;
LPC_CREG->M0SUBMEMMAP = 0x1C000000;
LPC_CCU1->CLK_M4_GPIO_CFG = CCU_CLK_CFG_AUTO | CCU_CLK_CFG_RUN ;
while (!(LPC_CCU1->CLK_M4_GPIO_STAT & CCU_CLK_STAT_RUN));
/* CLK_M4_GPIO_STAT can access as a read value and cant be written and the value which would depends on the CLK_M4_GPIO_CFG Configuration Register */
/* To configure The GPIO port as the write pin or output Pin or output port in word format or Byte format or Bit format */
/* To format the GPIO single pin in the output bit */
LPC_SCU->SFSPD_12 = 4;
/* The 4 value is the mode Value for the function 4 such that GPIO PORT GPIO6[26] */
LPC_GPIO_PORT->DIR[6] |= 1 << 6;
/* The value is the Directory value set the GPIO6[26] as the output bit Pin */
LPC_GPIO_PORT->SET[6] = 1 << 6 ;
while(1)
{
if(LPC_GPIO_PORT->PIN[0] && LPC_GPIO_PORT->PIN[1] == 0xFFFFFFFF)
{
*var = LPC_GPIO_PORT->PIN[6]; // Read the Port Number 6 and save it in the memory location 0x10080000
var++; // Increment the Address
}
}
}
Regards
Sujay