Browse Source

Change mem size, code now brakes after lcd init

main
Goran Mahovlic 2 years ago
parent
commit
e51c3cbb93
  1. 2
      Core/Src/freertos.c
  2. 2
      Core/Src/main.c
  3. 7
      Core/Src/my_lcd.c
  4. 83529
      Debug/stm32f746g-disco.hex
  5. 1
      Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.c
  6. 7
      Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_sdram.c
  7. 2
      Middlewares/eez/core/memory.h
  8. 6
      Src/lcd.cpp

2
Core/Src/freertos.c

@ -117,7 +117,7 @@ void MX_FREERTOS_Init(void) {
void StartDefaultTask(void *argument)
{
/* init code for USB_DEVICE */
MX_USB_DEVICE_Init();
//MX_USB_DEVICE_Init();
/* USER CODE BEGIN StartDefaultTask */
init();
/* Infinite loop */

2
Core/Src/main.c

@ -90,6 +90,8 @@ int main(void)
HAL_Init();
SystemClock_Config();
//PeriphCommonClock_Config();
MX_GPIO_Init();
//MY_LCD_Init();
#else
/* USER CODE END 1 */

7
Core/Src/my_lcd.c

@ -45,10 +45,10 @@ void MY_LCD_Init() {
HAL_LTDC_ProgramLineEvent(&hltdc_eval, 0);
/* Display example brief */
LCD_BriefDisplay();
//LCD_BriefDisplay();
/* Copy Buffer 0 into buffer 1, so only image area to be redrawn later */
CopyBuffer((uint32_t *)Buffers[0], (uint32_t *)Buffers[1], 0, 0, 800, 480);
CopyBuffer((uint32_t *)Buffers[0], (uint32_t *)Buffers[1], 0, 0, 480, 272);
}
/*
void MY_LCD_Tick() {
@ -115,6 +115,7 @@ static void LCD_BriefDisplay(void)
BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
BSP_LCD_SetFont(&Font16);
BSP_LCD_DisplayStringAtLine(1, (uint8_t *)" LCD_VideoMode_DoubleBuffering");
/*
BSP_LCD_FillRect(0, 0, 480, 272);
BSP_LCD_SetBackColor(LCD_COLOR_BLUE);
BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
@ -134,7 +135,7 @@ static void LCD_BriefDisplay(void)
BSP_LCD_SetFont(&Font16);
//BSP_LCD_DisplayStringAtLine(4, (uint8_t *)"This example shows how to display images on LCD DSI using two buffers");
//BSP_LCD_DisplayStringAtLine(5, (uint8_t *)"one for display and the other for draw ");
*/
}
/**

83529
Debug/stm32f746g-disco.hex

File diff suppressed because it is too large Load Diff

1
Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_lcd.c

@ -644,6 +644,7 @@ void BSP_LCD_Clear(uint32_t Color)
{
/* Clear the LCD */
LL_FillBuffer(ActiveLayer, (uint32_t *)(hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress), BSP_LCD_GetXSize(), BSP_LCD_GetYSize(), 0, Color);
__NOP();
}
/**

7
Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_sdram.c

@ -233,8 +233,11 @@ void BSP_SDRAM_Initialization_sequence(uint32_t RefreshCount)
/* Step 2: Insert 100 us minimum delay */
/* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
HAL_Delay(1);
// HAL_Delay(1);
for(int i=0;i<10000;i++){
__NOP();
}
/* Step 3: Configure a PALL (precharge all) command */
Command.CommandMode = FMC_SDRAM_CMD_PALL;
Command.CommandTarget = FMC_SDRAM_CMD_TARGET_BANK1;

2
Middlewares/eez/core/memory.h

@ -28,7 +28,7 @@ static uint8_t * const MEMORY_BEGIN = (uint8_t *)0xc0000000u;
#if CONF_OPTION_FPGA
static const uint32_t MEMORY_SIZE = 32 * 1024 * 1024;
#elif defined(EEZ_PLATFORM_STM32F469I_DISCO)
static const uint32_t MEMORY_SIZE = 16 * 1024 * 1024;
static const uint32_t MEMORY_SIZE = 8 * 1024 * 1024;
#else
static const uint32_t MEMORY_SIZE = 8 * 1024 * 1024;
#endif

6
Src/lcd.cpp

@ -36,14 +36,14 @@ static void OnError_Handler(uint32_t condition) {
void LCD_init() {
#ifdef EEZ_PLATFORM_STM32
uint8_t lcd_status = LCD_OK;
lcd_status = BSP_LCD_Init();
OnError_Handler(lcd_status != LCD_OK);
BSP_LCD_LayerDefaultInit(0, (uint32_t)eez::VRAM_BUFFER1_START_ADDRESS);
BSP_LCD_SelectLayer(0);
BSP_LCD_Clear(LCD_COLOR_BLACK);
//
// Code currently brakes here
BSP_LCD_Clear(LCD_COLOR_GREEN);
BSP_TS_Init(DISPLAY_WIDTH, DISPLAY_HEIGHT);
#endif

Loading…
Cancel
Save