2018-08-03 12:40 PM
Hi There,
I bought two STM32H743 Nucleo boards recently and did some tests on them. As usual, I first converted ST-Link v2 to JLink interface using the tool SEGGER provided. I have done this with F1, F4, and F7 series boards in order to use JLink RTT for debugging and never had any issue in the past. But when I tried with the new H743 board, I am not able to download the program to the chip using the JLinkExe command line, the way which I usually download programs to STM boards. Even though I can download to the H743 board using the AC3 IDE provided by STM, I am not able to debug after that. Right after the program is downloaded, it run in a wired loop and never be able to stop. Also I am not able to see the RTT debug outputs using the JLinkRTTClient terminal, as usual. I googled a couple of times regarding this question but got no answer.
Can you please kindly give me some hints for how to deal this kind of problems? Any comment will be highly appreciated!
Best regards,
Xiaoguang
2018-08-03 12:59 PM
There are some complications related to the SWD/SWV implementation and location of ROM Tables that might relate to this.
https://community.st.com/s/question/0D50X00009XkhURSAZ/stm32h7-swo-printf-not-working
2018-08-03 06:30 PM
The link you provided below is broken and I am not able to open it!
Clive Two.Zero (Community Member)
Posted on June 21, 2018 at 18:35
Confirming here that SWV output working with NUCLEO-H743ZI
https://community.st.com/docs/DOC-2098-how-to-use-the-swo-on-stm32h7-devices
By the way, do you have an official fix for this problem?
2018-08-03 07:13 PM
A number of posts seem to be broken since the forum was migrated to a new platform the other week.
Doesn't the post from Posted on June 21, 2018 at 12:30 provide a code example?
I cleaned it up to this
void SWD_Init(void)
{
*(__IO uint32_t*)(0x5C001004) |= 0x00700000; // DBGMCU_CR D3DBGCKEN D1DBGCKEN TRACECLKEN
//UNLOCK FUNNEL
*(__IO uint32_t*)(0x5C004FB0) = 0xC5ACCE55; // SWTF_CTRL
*(__IO uint32_t*)(0x5C003FB0) = 0xC5ACCE55; // SWO_LAR
//SWO current output divisor register
//This divisor value (0x000000C7) corresponds to 400Mhz
//To change it, you can use the following rule
// value = (CPU Freq/sw speed )-1
*(__IO uint32_t*)(0x5C003010) = (*(__IO uint32_t*)(0x5C003010) & 0xfffff000) | ((SystemCoreClock / 2000000) - 1); // SWO_CODR
//SWO selected pin protocol register
*(__IO uint32_t*)(0x5C0030F0) = 0x00000002; // SWO_SPPR
//Enable ITM input of SWO trace funnel
*(__IO uint32_t*)(0x5C004000) |= 0x00000001; // SWFT_CTRL
//RCC_AHB4ENR enable GPIOB clock
*(__IO uint32_t*)(0x580244E0) |= 0x00000002;
// Configure GPIOB pin 3 as AF
*(__IO uint32_t*)(0x58020400) = (*(__IO uint32_t*)(0x58020400) & 0xffffff3f) | 0x00000080;
// Configure GPIOB pin 3 Speed
*(__IO uint32_t*)(0x58020408) |= 0x00000080;
// Force AF0 for GPIOB pin 3
*(__IO uint32_t*)(0x58020420) &= 0xFFFF0FFF;
}
2018-08-04 09:35 AM
I have tried adding your code to mine, but it still didn't work.
Even though I can download my code to the nucleo board using JLinkExe and successfully run it, I am still not able to see the RTT output from the SeggerRTTClient terminal, and the SystemView gave a "Cannot find the RTT control block" error. I guess my problem was due to the reason that the RTT control block was located in the wrong memory region. Can you please tell me how to fix the problem?
PS: I attache my code to you for analysis.
int main(void)
{
/* Enable the CPU Cache */
CPU_CACHE_Enable();
/* STM32H7xx HAL library initialization:
- Systick timer is configured by default as source of time base, but user
can eventually implement his proper time base source (a general purpose
timer for example or other time source), keeping in mind that Time base
duration should be kept 1ms since PPP_TIMEOUT_VALUEs are defined and
handled in milliseconds basis.
- Set NVIC Group Priority to 4
- Low Level Initialization
*/
HAL_Init();
/* Configure the system clock to 400 MHz */
SystemClock_Config();
SWD_Init();
SEGGER_RTT_Init();
/* Configure LED1 */
BSP_LED_Init(LED1);
BSP_LED_Init(LED2);
BSP_LED_Init(LED3);
SEGGER_RTT_WriteString(0, RTT_CTRL_CLEAR);
SEGGER_RTT_printf(0, "Initialization successfully done! \r\n");
/*##-1- Configure the TIM peripheral #######################################*/
/* -----------------------------------------------------------------------
In this example TIM3 input clock (TIM3CLK) is set to APB1 clock (PCLK1),
since APB1 prescaler is equal to 2.
TIM3CLK = 2*PCLK1
PCLK1 = HCLK/2 as AHB Clock divider is set to RCC_HCLK_DIV2
=> TIM3CLK = HCLK = SystemCoreClock/2
To get TIM3 counter clock at 10 KHz, the Prescaler is computed as following:
Prescaler = (TIM3CLK / TIM3 counter clock) - 1
Prescaler = (SystemCoreClock /2*10 KHz) - 1
Note:
SystemCoreClock variable holds HCLK frequency and is defined in system_stm32h7xx.c file.
Each time the core clock (HCLK) changes, user had to update SystemCoreClock
variable value. Otherwise, any configuration based on this variable will be incorrect.
This variable is updated in three ways:
1) by calling CMSIS function SystemCoreClockUpdate()
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
----------------------------------------------------------------------- */
/* Compute the prescaler value to have TIMx counter clock equal to 10000 Hz */
uwPrescalerValue = (uint32_t)(SystemCoreClock / (2*10000)) - 1;
/* Set TIMx instance */
TimHandle.Instance = TIMx;
/* Initialize TIMx peripheral as follows:
+ Period = 10000 - 1
+ Prescaler = (SystemCoreClock/10000) - 1
+ ClockDivision = 0
+ Counter direction = Up
*/
TimHandle.Init.Period = 10000 - 1;
TimHandle.Init.Prescaler = uwPrescalerValue;
TimHandle.Init.ClockDivision = 0;
TimHandle.Init.CounterMode = TIM_COUNTERMODE_UP;
TimHandle.Init.RepetitionCounter = 0;
if (HAL_TIM_Base_Init(&TimHandle) != HAL_OK)
{
/* Initialization Error */
Error_Handler();
}
/*##-2- Start the TIM Base generation in interrupt mode ####################*/
/* Start Channel1 */
if (HAL_TIM_Base_Start_IT(&TimHandle) != HAL_OK)
{
/* Starting Error */
Error_Handler();
}
/* Infinite loop */
while (1)
{
HAL_Delay(500);
BSP_LED_Toggle(LED2);
SEGGER_RTT_printf(0, "In MAIN LOOP ... ! \r\n");
}
}
2018-08-04 10:48 AM
>>Can you please tell me how to fix the problem?
No, Seek support from Segger
The H7 has several RAM and FLASH regions/mappings, you should be perhaps look at what Segger needs/expects, or changing the data areas around to see what works.
2018-08-06 08:33 PM
Hi There,
I have found the solution for solving the problem by myself.
Sorry I have another simple quick question for you here. This time it is about the hardware.
Your STM32H743ZI Nucleo board does not come with the dual row 2.54mm double-sided pin headers for chip pin connections, as usually do with other old nucleo and discovery boards. I don't konw if this was due to the cost issue or not, but it is really causing troubles to customers for doing board evaluation/project developments. Can you please reflect this issue to your management team? I guess you can still keep those pin headers on board and raise the price as you like. No one really cares about a few more bucks but it is really difficult for them to find the pin headers and solder them onto the board!
Can you please kindly tell me where I can purchase those headers? What manufacture/model/part# are those headers?
I really missed them, though :((
Thanks.
2018-08-07 01:14 AM
It is bad habit to talk about a solution but not to explain the solution. And it is also bad habit to bring up another issue in an already existing thread.
2018-08-07 10:31 AM
Uwe Bonnes,
I don't know who you are but you are not supposed to judge your customers!
I didn't ask you any question and you are not supposed to answer anything!
Supposedly you should be able to provide solutions to your customers, not the other way around, but you failed! Which means you are not qulified for your job and should leave now!
I pointed out some of the defects of STM for releasing an incomplete product to the market, which means I am doing you a favor and helping you to improve your product quality. You should be grateful for this. But in return you are insulting your customer and showed your immaturity!
I have worked with many other companies and never have had experiences like this. SHAME ON YOU!
I will comtact STMicroelectronics management team and let them know about this!
Again, you are not qualified for your job and should consider to leave, and never come back again!
2018-08-07 12:42 PM
Some customers are morons, don't be one of those customers..
Community Member != ST Employee
>>Your STM32H743ZI Nucleo board does not come with the dual row...
I don't work for ST, neither does Uwe, this is a user forum, people have varied opinions. We come from places that don't censor opinions.
>>but it is really causing troubles to customers for doing board evaluation/project developments
Thing is customers have a lot of different requirement/expectations, there is no right answer.
Some also like to solder wire into empty thru-hole.
Others think a wall of pin headers to be too crowded.
Some want headers on top side, some on bottom side.
I'm an EE and got a whole bag of 40x2 pin headers I can solder on if I get the urge. Sort of thing you can pick up at Mouser, DigiKey or Samtec.