cancel
Showing results for 
Search instead for 
Did you mean: 

Program flash problem

chethurocks
Associate II
Posted on January 21, 2013 at 11:12

Hey Hi, I have been using stm32f103zet6 (144 pin package, Keil compiler and the debugger is stlink ). In my program i use the Jtag pins as Jtag/Port pins (Depending upon the jumper position and a condition in a program ). I wanted to debug the program so i removed the condition, now its not allowing me to flash any program . The condition in the program is

GPIOC->CRH &= 0xFF0FFFFF; //PC13 for enable/disable JTAG (FACTORY SETTING)

GPIOC->CRH |= 0x00400000;

 if((GPIOC->IDR &= 0x2000) == 0)

{

AFIO->MAPR &= 0xF8FFFFFF;

while(1)

;

 }

else

{

AFIO->MAPR |= 0x04000000;

 }

So i need help to over come this problem ASAP
3 REPLIES 3
Posted on January 21, 2013 at 14:02

Why the '&=' here?

 if((GPIOC->IDR &= 0x2000) == 0)

Do you have an LED or something to signal which code path you have entered? How about outputting telemetry via a serial port?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
chethurocks
Associate II
Posted on January 22, 2013 at 06:54

Hey actually im using this condition in my main application program

 if((GPIOC->IDR &= 0x2000) == 0)

Could you please tell me how to bring the controller to System memory using boot configuration, i have done as it is given in the stm family manual i.e, BOOT0 =1(3.3v) and BOOT1=0(GND) but nothing happened. 

Posted on January 22, 2013 at 08:38

Booting with BOOT0 High should get you into the system loader. From there it will sit waiting for a pattern on the USART pins.

Make sure you have the AFIO and GPIO clocks enabled.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..