develop enviroment : RM48L952, freeRTOS, (disable MPU).
I control GIO high or low in a task.
use dmmPort as the GIO pin.
when CPU in privilege mode, it does work.
when CPU in user mode, it does not work, I can't control the GIO.
I am confusing.
In SPNU503B-RM48x 1632-Bit RISC Flash Microcontroller.pdf , chapter 30.3, describe this:
DMMPC0~DMMPC8 User and privilege mode (write)
my code:
#define portRESET_PRIVILEGE( xRunningPrivileged ) if( xRunningPrivileged == 0 ) portSWITCH_TO_USER_MODE()
#pragma SWI_ALIAS(prvRaisePrivilege, 1);
extern BaseType_t prvRaisePrivilege(void);
void laser0Ctrl(uint8 value)
{
uint8 cmd = value ? 0:1;
portBASE_TYPE xRunningPrivileged = prvRaisePrivilege();
gioSetBit(dmmPORT, 13, cmd);
portRESET_PRIVILEGE(xRunningPrivileged);
}
why i can't write register in user mode.