We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Dear Colleagues,
A bought an MCBSTR9 DSK + Ulink2 programmer. I never had so much trouble with lack of a good quickstart documentation than with this setup.
My problem: I wrote simple program that should just switch on every 2nd pin on GPIO7 and run in an endless loop (just in case), but it actually doesn't do anything (even the port direction, data, etc registers don't respond - the debugger shows they're all reset all the time). For what I can see, it does compile and load correctly
In the configuration file (STR91x.s) I left all by default, except that I switched on the Port Clock Gating for GPIO7
Can someone please tell me what am I missing here?
Here's my simple program:
#include <91x_lib.h>
int main (void) {
GPIO_InitTypeDef GPIO_InitStruct;
GPIO_DeInit(GPIO7);
GPIO_InitStruct.GPIO_Direction = GPIO_PinOutput;
GPIO_InitStruct.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStruct.GPIO_Type = GPIO_Type_PushPull ;
GPIO_Init (GPIO7, &GPIO_InitStruct);
GPIO_Write(GPIO7, 0xAA);
while(1); }
Best Regards, Istvan
The program isn't running at all. (PC is on 0 all the time), or the device is in reset all the time. I must me missing some major clocking issue which actually messes up the debugger too (I'm often geting the Can't stop the device error when I start up the debugger) - and not it's not a driver problem, the example programs work well!
I wonder how did you guys start with this board. When I manage to make this board run, I'll write a beginner's manual, for the quick start guide says, just create a new project, set up the device and go. I wish.
Nevertheless, I think I'm seting up the project correctly - nothing much to miss there. I'll look up around the configuration wizard.
I've managed to trace the program. It actually stops at the very start of the initialisation file (STR91x.s).
The reset starts with:
Vectors LDR PC, Reset_Addr LDR PC, Undef_Addr
Instead of jumping to the proper reset/boot routine it continues to the 2nd line (Undef_Addr) and runs there in an endless loop.
I looked up the Reset_Addr in the source, it's as follows:
Reset_Addr DCD Reset_Handler
and then Reset_Handler:
EXPORT Reset_Handler Reset_Handler NOP ; Wait for OSC stabilization NOP NOP NOP NOP NOP NOP NOP
....etc and then the initialisation starts, but it never gets here. It just runs in an endless loot on the 2nd instruction.
This is all located in the same (init) file.
I'm looking it up now, but do you have any hints about this?
Best regards, Istvan
Right. I got used to answer my own questions. I missed to include the 91x_it.c interrupt handler file. The program seems to be running now but nothing seems to be happening. I tried to measure the voltages on the board - nothing, and also when I open Peripherals -> GPIO7 it's naturally also all reset. Infacet, when I open the Power System and Clock Control window, it also shows no changes, regardless that I have made changes to the Configuration Wizard (tried to turn the PLL on/off etc, but it doesn't reglect to the device)...
Any help about this? What I can say is, that I to connect to the board and I'm not in simulation mode - I'm definitely debugging live.