diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-07-31 09:11:24 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-07-31 09:11:24 -0600 |
commit | 0129369fb0a18310f44dd6ff039c33d61c519532 (patch) | |
tree | 3405bd07bb03401bf03520eaf0525bd552854427 | |
parent | 69d1faa894c8f0c6a9c526793fa6b54b303cd4f4 (diff) | |
download | nuttx-0129369fb0a18310f44dd6ff039c33d61c519532.tar.gz nuttx-0129369fb0a18310f44dd6ff039c33d61c519532.tar.bz2 nuttx-0129369fb0a18310f44dd6ff039c33d61c519532.zip |
SAMA5: Modification of some CPSR-related inline functions
-rwxr-xr-x | nuttx/arch/arm/include/armv7-a/irq.h | 17 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/README.txt | 17 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/nor_main.c | 4 |
3 files changed, 27 insertions, 11 deletions
diff --git a/nuttx/arch/arm/include/armv7-a/irq.h b/nuttx/arch/arm/include/armv7-a/irq.h index 51a9702ae..09880f450 100755 --- a/nuttx/arch/arm/include/armv7-a/irq.h +++ b/nuttx/arch/arm/include/armv7-a/irq.h @@ -250,16 +250,15 @@ struct xcptcontext #ifndef __ASSEMBLY__ -/* Disable IRQs and return the previous IRQ state */ +/* Return the current IRQ state */ -static inline irqstate_t irqsave(void) +static inline irqstate_t irqstate(void) { unsigned int cpsr; __asm__ __volatile__ ( "\tmrs %0, cpsr\n" - "\tcpsid i\n" : "=r" (cpsr) : : "memory" @@ -268,16 +267,16 @@ static inline irqstate_t irqsave(void) return cpsr; } -/* Enable IRQs and return the previous IRQ state */ +/* Disable IRQs and return the previous IRQ state */ -static inline irqstate_t irqenable(void) +static inline irqstate_t irqsave(void) { unsigned int cpsr; __asm__ __volatile__ ( "\tmrs %0, cpsr\n" - "\tcpsie i\n" + "\tcpsid i\n" : "=r" (cpsr) : : "memory" @@ -286,16 +285,16 @@ static inline irqstate_t irqenable(void) return cpsr; } -/* Disable IRQs and return the previous IRQ state */ +/* Enable IRQs and return the previous IRQ state */ -static inline irqstate_t irqdisable(void) +static inline irqstate_t irqenable(void) { unsigned int cpsr; __asm__ __volatile__ ( "\tmrs %0, cpsr\n" - "\tcpsid i\n" + "\tcpsie i\n" : "=r" (cpsr) : : "memory" diff --git a/nuttx/configs/sama5d3x-ek/README.txt b/nuttx/configs/sama5d3x-ek/README.txt index 4300fd86a..66a7e760b 100644 --- a/nuttx/configs/sama5d3x-ek/README.txt +++ b/nuttx/configs/sama5d3x-ek/README.txt @@ -759,3 +759,20 @@ Configurations FLASH by closing the BMS jumper (J9). As far as I can tell, this jumper does nothing on my board??? I have been using the norboot configuration to start the program in NOR FLASH (see just above). + I do that as follows: + + 1. I build the norboot configuration and rename nuttx to norboot + 2. I build the the ostest configuration and write it to NOR FLASH + using SAM-BA + 3. Then I start the J-Link GDB server and GDB. In GDB, I do the + following: + + (gdb) mon reset # Reset and halt the CPU + (gdb) load norboot # Load norboot into internal SRAM + (gdb) mon go # Start norboot + (gdb) mon halt # Break in + (gdb) mon reg pc = 0x10000040 # Set the PC to NOR flash entry point + (gdb) mon go # And jump into NOR flash + + 2013-7-31: + The OS test configuration is functional. diff --git a/nuttx/configs/sama5d3x-ek/src/nor_main.c b/nuttx/configs/sama5d3x-ek/src/nor_main.c index 117f71c9e..472086d9e 100644 --- a/nuttx/configs/sama5d3x-ek/src/nor_main.c +++ b/nuttx/configs/sama5d3x-ek/src/nor_main.c @@ -122,12 +122,12 @@ int nor_main(int argc, char *argv) putreg32(regval, SAM_HSMC_MODE(HSMC_CS0)); /* Interrupts must be disabled through the following. In this configuration, - * there should only be timer interupts. Your NuttX configuration must use + * there should only be timer interrupts. Your NuttX configuration must use * CONFIG_SERIAL_LOWCONSOLE=y or printf() will hang when the interrupts * are disabled! */ - (void)irqdisable(); + (void)irqsave(); /* Disable MATRIX write protection */ |