[En-Nut-Discussion] Ethernut on TI's Cortex-M3 (Stellaris LM3S...)
phip at hb9etc.ch
Wed Oct 17 22:20:58 CEST 2012
On 10/16/2012 10:52 AM, Ole Reinhardt wrote:
> Hi Philipp,
> I would suppose that the AHB / APB clocks and/or power domains are
> not configured correctly.
> This would result in a BusFault as soon as you access any peripheral
> connected to these busses.
Ok, I got it. I've just been an idiot. In fact, I've even pointed my
mistake out before, have a look:
>> main(). After that, the "run mode clock gating register 2 (RCGC2)"
>> is set to 0x000f, which should enable the clock to GPIO ports A
>> through H. It then does a few dummy reads from the same register,
>> just as noted in
I wrote 0x000f and expected port A through H to be enabled. Well, how to
enable 8 ports with 4 ones? This should have been 0x00ff of course!
Changed it and everything works now :)
> If you look at my LPC port, the core files (which handle the CPU
> startup and basic clock configuration) are
> The system file does not do much relevant things and is just a
> placeholder if later any CPU initialisation needs to be added, but
> the clock file is very important:
> You should at least implement
> SetSysClock() and SysCtlClockGet()
Yep, I've implemented dummies for these. If no clock is set, the
processor simply runs at 16MHz from its internal oscillator.
> And you should also implement a
> And connect all these functions with the
> timer.c and
> nut/arch/cm3/os/nutinit.c nut/arch/cm3/cmsis/ostimer_cortex.c
> Have you done this? (I did not check you latest git files...)
Not yet, but since my LED now blinks, this could be the next step.
I'm sorry that I wasted your time because of such a... bug. Or however
one might call it.
I've got a working basis now, at last. So the next thing to do is to
improve the clock setup and then the GPIO controller. Harald/Uwe hit the
right spot in time for their RFAs, so I now have a detailed
specification about how to implement the GPIO driver ;)
Oh, and the file/folder-related problems mentioned by Uwe are also still
More information about the En-Nut-Discussion