被转换的类型建议用括号包含起来

#define WRITE32  (*(volatile uint32*) ((unsigned long) addr) = (uint32)(data))

建议改成 (*(volatile uint32*) ((unsigned long) (addr)) = (uint32)(data))

否则,在做WRITE32(addr + i)时,会出现访问预期之外的地址