野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 388|回复: 2

【求助】H750 Pro下载时找不到设备

[复制链接]
发表于 2023-10-23 23:35:54 | 显示全部楼层 |阅读模式
今天板子到手,因为有折腾H7B0的经验,就打算直接实现BOOT+APP的程序
备注:
1.新板子上电是可以点亮和显示RGB-LCD的
2.单独的核心板,没有底板

一开始打算先实现APP,但使用“embedFire-H750V-W25Q256-SDRAM.FLM”始终无法下载

只能搁置,转战弄Boot。野火的例程“H750-TWIN-QSPI-BOOTLOADER”可以烧写使用,然后就以此为基础移植到CubeMX生成的工程中。
(移植的目的主要是精简下printf的内容,同时去除GB2312中文的打印以适配UTF8的串口助手)

离谱的开始了,此时使用ST-Link(无HW REST)烧写代码到内部的0x8000000后,单片机并没有输出信息,反而在RST后下载器显示“无目标连接了”
一阶段:此时可以通过点击下载的同时按下复位按钮,就可以下载了
过程中来回烧录几次自己的boot和野火的bootloader

二阶段:ST-Link无法识别与下载,换用野火的DAP-Link进行下载,有如下报错
QQ截图20231023225336.png     QQ截图20231023225404.png   
设置成”under Rest“后可以到下一步,但是依旧报错
QQ截图20231023225936.png    QQ截图20231023225944.png
之后在CSDN找到教程,改变下RAM区域设置,可以下载,但这样做的后果是手上的两种link都没法识别芯片了
QQ截图20231023230237.png

截至目前,怀疑是某些区域锁了,但由于STM32CubeProgrammer连接不上,没法进一步判断。

补充,源代码:
  1. /* USER CODE BEGIN Header */
  2. /**
  3.   ******************************************************************************
  4.   * [url=home.php?mod=space&uid=90986]@file[/url]           : main.c
  5.   * [url=home.php?mod=space&uid=41770]@brief[/url]          : Main program body
  6.   ******************************************************************************
  7.   * @attention
  8.   *
  9.   * Copyright (c) 2023 STMicroelectronics.
  10.   * All rights reserved.
  11.   *
  12.   * This software is licensed under terms that can be found in the LICENSE file
  13.   * in the root directory of this software component.
  14.   * If no LICENSE file comes with this software, it is provided AS-IS.
  15.   *
  16.   ******************************************************************************
  17.   */
  18. /* USER CODE END Header */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "main.h"
  21. #include "quadspi.h"
  22. #include "usart.h"
  23. #include "gpio.h"

  24. /* Private includes ----------------------------------------------------------*/
  25. /* USER CODE BEGIN Includes */
  26. #include "bsp_qspi_flash.h"
  27. /* USER CODE END Includes */

  28. /* Private typedef -----------------------------------------------------------*/
  29. /* USER CODE BEGIN PTD */
  30. typedef void (*pFunction)(void);
  31. pFunction JumpToApplication;
  32. /* USER CODE END PTD */

  33. /* Private define ------------------------------------------------------------*/
  34. /* USER CODE BEGIN PD */
  35. #ifndef APPLICATION_ADDRESS
  36. #define APPLICATION_ADDRESS QSPI_BASE
  37. #endif
  38. /* USER CODE END PD */

  39. /* Private macro -------------------------------------------------------------*/
  40. /* USER CODE BEGIN PM */

  41. /* USER CODE END PM */

  42. /* Private variables ---------------------------------------------------------*/

  43. /* USER CODE BEGIN PV */

  44. /* USER CODE END PV */

  45. /* Private function prototypes -----------------------------------------------*/
  46. void SystemClock_Config(void);
  47. /* USER CODE BEGIN PFP */

  48. /* USER CODE END PFP */

  49. /* Private user code ---------------------------------------------------------*/
  50. /* USER CODE BEGIN 0 */

  51. /* USER CODE END 0 */

  52. /**
  53.   * @brief  The application entry point.
  54.   * @retval int
  55.   */
  56. int main(void)
  57. {
  58.   /* USER CODE BEGIN 1 */

  59.   /* USER CODE END 1 */

  60.   /* MCU Configuration--------------------------------------------------------*/

  61.   /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  62.   HAL_Init();

  63.   /* USER CODE BEGIN Init */

  64.   /* USER CODE END Init */

  65.   /* Configure the system clock */
  66.   SystemClock_Config();

  67.   /* USER CODE BEGIN SysInit */

  68.   /* USER CODE END SysInit */

  69.   /* Initialize all configured peripherals */
  70.   MX_GPIO_Init();
  71.   MX_USART1_UART_Init();
  72.   MX_QUADSPI_Init();
  73.   /* USER CODE BEGIN 2 */
  74.   printf("\r\n");
  75.   printf("EmbedFireH750Pro Boot\r\n");
  76.   printf("STM32H750XB\r\n");
  77.   
  78.   QSPI_FLASH_Init();
  79.   
  80.   SCB_DisableICache();
  81.   SCB_DisableDCache();

  82.   __disable_irq();
  83.   SysTick->CTRL = 0;
  84.   SysTick->VAL = 0;
  85.   
  86. printf("Jump to APP at 0x%p\r\n", (void*)APPLICATION_ADDRESS);
  87. JumpToApplication = (pFunction) (*(__IO uint32_t*) (APPLICATION_ADDRESS + 4));
  88. __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
  89. JumpToApplication();
  90.   /* USER CODE END 2 */

  91.   /* Infinite loop */
  92.   /* USER CODE BEGIN WHILE */
  93.   while (1)
  94.   {
  95.     /* USER CODE END WHILE */

  96.     /* USER CODE BEGIN 3 */
  97.   }
  98.   /* USER CODE END 3 */
  99. }

  100. /**
  101.   * @brief System Clock Configuration
  102.   * @retval None
  103.   */
  104. void SystemClock_Config(void)
  105. {
  106.   RCC_OscInitTypeDef RCC_OscInitStruct = {0};
  107.   RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};

  108.   /** Supply configuration update enable
  109.   */
  110.   HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);

  111.   /** Configure the main internal regulator output voltage
  112.   */

  113.   while(!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}

  114.   /** Initializes the RCC Oscillators according to the specified parameters
  115.   * in the RCC_OscInitTypeDef structure.
  116.   */
  117.   RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
  118.   RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;
  119.   RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
  120.   RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  121.   RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
  122.   RCC_OscInitStruct.PLL.PLLM = 4;
  123.   RCC_OscInitStruct.PLL.PLLN = 60;
  124.   RCC_OscInitStruct.PLL.PLLP = 2;
  125.   RCC_OscInitStruct.PLL.PLLQ = 2;
  126.   RCC_OscInitStruct.PLL.PLLR = 2;
  127.   RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_3;
  128.   RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
  129.   RCC_OscInitStruct.PLL.PLLFRACN = 0;
  130.   if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
  131.   {
  132.     Error_Handler();
  133.   }

  134.   /** Initializes the CPU, AHB and APB buses clocks
  135.   */
  136.   RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
  137.                               |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
  138.                               |RCC_CLOCKTYPE_D3PCLK1|RCC_CLOCKTYPE_D1PCLK1;
  139.   RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  140.   RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1;
  141.   RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2;
  142.   RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV2;
  143.   RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2;
  144.   RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2;
  145.   RCC_ClkInitStruct.APB4CLKDivider = RCC_APB4_DIV2;

  146.   if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
  147.   {
  148.     Error_Handler();
  149.   }
  150. }
复制代码


MPU配置参考了一些LCD例程
QQ截图20231023225612.png

回复

使用道具 举报

 楼主| 发表于 2023-10-23 23:40:05 | 显示全部楼层
本帖最后由 _Undefined 于 2023-10-24 09:58 编辑

迷惑的又来了,发完帖子后,换上DAP又能识别了,
下载了野火的boot后,串口有输出
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-10-24 10:04:31 | 显示全部楼层
经实验,“embedFire-H750V-W25Q256-SDRAM.FLM“在使用ST-LinkV2时无法下载,而使用野火的DAP则可以下载。啥情况
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-4-28 22:57 , Processed in 0.128348 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表