microbuilder / LPC810_CodeBase

Open source code base for the ARM Cortex M0+ LPC810 family from NXP
85 stars 43 forks source link

LPC_MRT->IRQ_FLAG address wrong #16

Open frankvnk opened 8 years ago

frankvnk commented 8 years ago

While i was debugging some code, i noticed LPC_MRT->IRQ_FLAG always returned 0. I found the solution at https://www.lpcware.com/content/forum/lpcmrt-irqflag-address-wrong

lpc8xx.h in CMSIS

In LPC_MRT_TypeDef struct, change Reserved0[1] into Reserved0[45]

typedef struct {
  MRT_Channel_cfg_Type Channel[4];      
   uint32_t Reserved0[1];               
  __IO uint32_t IDLE_CH;            
  __IO uint32_t IRQ_FLAG;                       
} LPC_MRT_TypeDef;

should be

typedef struct {
  MRT_Channel_cfg_Type Channel[4];      
   uint32_t Reserved0[45];              
  __IO uint32_t IDLE_CH;            
  __IO uint32_t IRQ_FLAG;                       
} LPC_MRT_TypeDef;

Questions Is this codebase still maintained? Is this codebase usable with any LPC810 mcu revision? I used this codebase with the LPC800 mini kit (LPC810 rev 2X) and everything worked fine but when i flashed the same code to an LPC810 rev 4C, the code no longer works - see my post at https://www.lpcware.com/content/forum/lpc810-differences-between-rev-2x-and-rev-4c

microbuilder commented 8 years ago

I haven't been using the LPC81x/LPC82x lately, though I'm still definitely interested in the chip family since it's hard to argue with the extremely competitive price. If you have a pull request, I'll be more than happy to integrate any changes. I'll have to get my hands on a more recent chip revision to comment on your questions, though.