Skip to main content
chethurocks
Associate II
January 21, 2013
Question

Program flash problem

  • January 21, 2013
  • 3 replies
  • 999 views
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
    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    January 21, 2013
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    chethurocks
    Associate II
    January 22, 2013
    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. 

    Tesla DeLorean
    Guru
    January 22, 2013
    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 VenmoUp vote any posts that you find helpful, it shows what's working..