Thanks for the review Karl. Frantisek and I also had this discussion and in
the rev 5 version of the reference manual (RM0090) AHB3 is at 0xa000000 not
0x6000000. Which reference are you using to get the 0x6000000 number? Page
64 of the Rev 5 manual defines the AHB3 memory range ax 0xa0000000 to
0xa000 0fff

Also thanks for the tip on using the U suffix.


On Sun, Jan 19, 2014 at 4:25 AM, Karl Palsson <notifications@github.com>wrote:

> In include/libopencm3/stm32/f4/memorymap.h:
>
> > @@ -29,8 +29,8 @@
> >  #define PERIPH_BASE_APB1		(PERIPH_BASE + 0x00000)
> >  #define PERIPH_BASE_APB2		(PERIPH_BASE + 0x10000)
> >  #define PERIPH_BASE_AHB1		(PERIPH_BASE + 0x20000)
> > -#define PERIPH_BASE_AHB2		0x50000000
> > -#define PERIPH_BASE_AHB3		0x60000000
> > +#define PERIPH_BASE_AHB2		(uint32_t) 0x50000000
> > +#define PERIPH_BASE_AHB3		(uint32_t) 0xA0000000
>
> This is not right, AHB3 is definitely at 0x60000000 in the datasheet, and
> adding a cast to a literal is just going to do weird things later. this
> should instead be (I believe)
>
> #define PERIPH_BASE_AHB3 0x6000000U
> #define FSMC_BASE (PERIPH_BASE_AHB3 + 0x4000000U)
>
> This makes the literals unsigned, which should then do "the right thing"
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/libopencm3/libopencm3/pull/229/files#r8991991>
> .
>