Hello!
I'm new to the whole line of TI processors, and tasked with getting a complex RTOS application running and ready for market on an AM3358 with resistive touch screen. (I'm not new to firmware programming, and not new to RTOS concepts and have a few complex RTOS products already out in the field and running well.) So I am taking myself through the learning steps one at a time. Currently, I'm trying to do one of the exercises (Labs) in the TI-RTOS training videos (TI-RTOS Workshop Series with Eric Wilbur), which is implementing a sort of "hello world" using SYS/BIOS (TI-RTOS Kernel) to simply blink an LED. I am currently working with the AM335x Starter Kit board, so I'm having to adapt several things (including changes in the software versions of CCS and SYS/BIOS since those videos were made).
Using StarterWare, I was previously able to perfectly control all 4 LEDs on the Starter Kit board. So I took the key code from that and placed the hardware initialization code (only the GPIO1 module) at the top of main (this is just a test application), and the Lab (exercise) is meant to use the RTOS Idle thread to blink the LED (the simplest of simple RTOS architectures for an application).
To keep it simple, I'm using SYS/BIOS v6.45.00.20 (latest release as of a couple of weeks ago).
The problem I am running into is that as soon as I write to the register to enable to GPIO1 clock(s), I am getting a CPU exception. Specifically, this is the very first step of setting up the GPIO1 pins. As soon as I step through this line, I get a CPU exception.
HWREG(SOC_CM_PER_REGS + CM_PER_GPIO1_CLKCTRL) |= CM_PER_GPIO1_CLKCTRL_MODULEMODE_ENABLE;
where
#define HWREG(x) \
(*((volatile unsigned int *)(x)))
and
#define SOC_PRCM_REGS (0x44E00000)
#define SOC_CM_PER_REGS (SOC_PRCM_REGS + 0)
#define CM_PER_GPIO1_CLKCTRL (0xac)
#define CM_PER_GPIO1_CLKCTRL_MODULEMODE_ENABLE (0x2u)
=-=-=-=
Is there some kind of UNLOCK I am supposed to do first (to avoid the exception) that wasn't needed under StarterWare? If so should this hardware initialization code go earlier in the SYS/BIOS initialization sequence (before the 'main' function in my tiny application)?
(And if anyone knows a tried-and-true training sequence for my situation, that would be helpful as well.)
Kind regards,
Vic