JTAG (J-Link) not working when programming first time?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
user_2177781
Level 5
Level 5
25 likes received 10 likes received 5 likes given

Hello,

I'm having a "problem" with my j-link and the WICED IDE. When I reconnect my board after it has been powered down, my j-link seems to be able to program the MCU, but when the j-link resets the MCU and the program should start running, nothing happens.

To fix this, I found a work-around in flashing it with some demo code from ST using the onboard st-link/v2. When a program has been successfully flashed, I am now able to flash using the j-link and programs now runs when the j-link resets the target at the end.

I'm working with a STM32F429 connected to a SN8000 module with a jlink connected to the STM32 MCU. Currently running WICED SDK 3.1.2.

Does anybody knows why this happens?

0 Likes
1 Solution

Here is a small follow up to close this thread.

My problem was that I forgot to change the PLL values to match the custom PCB, hence it did not seem to be running. When fixing this mistake, the board runs perfectly. The custom PCB can be flashed using WICED and the power down problems seen on the STM32F429 Discovery board, has not shown up on the custom PCB.

All in all, the custom PCB can be flashed using a j-link in both IAR or WICED, so problem solved.

View solution in original post

0 Likes
8 Replies
Anonymous
Not applicable

Sometimes I faced the issue,, so did the power on reset,, but after some time (code flashing & reflashing) this issue disappeared, I'll note what's actually happening when this occurs in the next time ?

0 Likes

Hi,

Try adding "reset_config trst_and_srst srst_open_drain" at the end of ...\tools\OpenOCD\jlink.cfg.

Seyhan

0 Likes

I have been using "reset_config trst_and_srst srst_push_pull srst_nogate connect_assert_srst" which I found in another thread. Changing it to "reset_config trst_and_srst srst_open_drain" does not seem to change anything.

Every time my board has been fully powered down, it is not able to run. No text in uart, no blinking LED and so on. To get it started I need to flash it using IAR and a demo project delivered from ST with the on-board ST-link. When it is running the demo code I am then able to flash it using WICED, but as mentioned, only until next power down.

The ST code does not have this problem and is able to run after a full power down.

0 Likes

I have now received a custom board, with the STM32F427 MCU, if I use the "reset_config trst_and_srst srst_open_drain" line, it gives me openOCD failed, but I managed to get it to download using "reset_config trst_and_srst srst_push_pull srst_nogate connect_assert_srst", but the code does not seem to run when it finished.

Is there any way to check that the code was actually flashed ?

0 Likes

Here is a small follow up to close this thread.

My problem was that I forgot to change the PLL values to match the custom PCB, hence it did not seem to be running. When fixing this mistake, the board runs perfectly. The custom PCB can be flashed using WICED and the power down problems seen on the STM32F429 Discovery board, has not shown up on the custom PCB.

All in all, the custom PCB can be flashed using a j-link in both IAR or WICED, so problem solved.

0 Likes
Anonymous
Not applicable

Where did you change the PLL values? in a cfg file or elsewhere? what value did you set it to?

0 Likes

mkochhal

The PLL value is set in the platform_config.h file under the specific platform. Here you set the PLL_SOURCE, PLL_M, PLL_N, PLL_P and PLL_Q values.

For at STM MCU, ST has an excel document where you can specify the CPU Clock would desire and get the needed values from there.

On a STM32F427 we are running at 168MHz with the following value:

#define CPU_CLOCK_HZ         ( 168000000 )

#define PLL_M_CONSTANT       ( 26 )

#define PLL_N_CONSTANT       ( 336 )

#define PLL_P_CONSTANT       ( 2 )

#define PLL_Q_CONSTANT       ( 7 )

Anonymous
Not applicable
0 Likes