SDRAM basic example for DISCO-F769NI

Dependencies:   BSP_DISCO_F769NI

Files at this revision

API Documentation at this revision

Comitter:
Jerome Coutant
Date:
Fri Nov 15 16:39:35 2019 +0100
Parent:
1:6683ab395ac6
Commit message:
Update with STM32Cube_FW_F7_V1.15.0

Changed in this revision

.hgignore Show annotated file Show diff for this revision Revisions of this file
BSP_DISCO_F769NI.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
diff -r 6683ab395ac6 -r 0cfdd4157b1e .hgignore
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Fri Nov 15 16:39:35 2019 +0100
@@ -0,0 +1,2 @@
+BUILD
+mbed-os/
diff -r 6683ab395ac6 -r 0cfdd4157b1e BSP_DISCO_F769NI.lib
--- a/BSP_DISCO_F769NI.lib	Wed Jun 07 11:46:22 2017 +0000
+++ b/BSP_DISCO_F769NI.lib	Fri Nov 15 16:39:35 2019 +0100
@@ -1,1 +1,1 @@
-https://mbed.org/teams/ST/code/BSP_DISCO_F769NI/#39d2c2c79afa
+https://mbed.org/teams/ST/code/BSP_DISCO_F769NI/#d13d7c447539
diff -r 6683ab395ac6 -r 0cfdd4157b1e main.cpp
--- a/main.cpp	Wed Jun 07 11:46:22 2017 +0000
+++ b/main.cpp	Fri Nov 15 16:39:35 2019 +0100
@@ -1,10 +1,9 @@
 #include "mbed.h"
-#include "stm32f769i_discovery.h"
 #include "stm32f769i_discovery_lcd.h"
 #include "stm32f769i_discovery_sdram.h"
 
 static void Fill_Buffer(uint32_t *pBuffer, uint32_t uwBufferLenght, uint32_t uwOffset);
-static uint8_t Buffercmp(uint32_t* pBuffer1, uint32_t* pBuffer2, uint16_t BufferLength);
+static uint8_t Buffercmp(uint32_t *pBuffer1, uint32_t *pBuffer2, uint16_t BufferLength);
 
 #define BUFFER_SIZE            ((uint32_t)0x0100)
 #define WRITE_READ_ADDR        ((uint32_t)0x0800)
@@ -28,8 +27,10 @@
     BSP_LCD_SetFont(&Font24);
     BSP_LCD_DisplayStringAt(0, 0, (uint8_t *)"SDRAM basic example", CENTER_MODE);
 
+    HAL_Delay(2000);
+
     /* SDRAM device configuration */
-    if(BSP_SDRAM_Init() != SDRAM_OK) {
+    if (BSP_SDRAM_Init() != SDRAM_OK) {
         BSP_LCD_DisplayStringAt(20, 100, (uint8_t *)"SDRAM Initialization : FAILED", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(20, 100, (uint8_t *)"SDRAM Initialization : OK", LEFT_MODE);
@@ -37,21 +38,27 @@
     /* Fill the buffer to write */
     Fill_Buffer(sdram_aTxBuffer, BUFFER_SIZE, 0xA244250F);
 
+    HAL_Delay(2000);
+
     /* Write data to the SDRAM memory */
-    if(BSP_SDRAM_WriteData(SDRAM_WRITE_READ_ADDR + WRITE_READ_ADDR, sdram_aTxBuffer, BUFFER_SIZE) != SDRAM_OK) {
+    if (BSP_SDRAM_WriteData(SDRAM_WRITE_READ_ADDR + WRITE_READ_ADDR, sdram_aTxBuffer, BUFFER_SIZE) != SDRAM_OK) {
         BSP_LCD_DisplayStringAt(20, 130, (uint8_t *)"SDRAM WRITE : FAILED", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(20, 130, (uint8_t *)"SDRAM WRITE : OK", LEFT_MODE);
     }
 
+    HAL_Delay(2000);
+
     /* Read back data from the SDRAM memory */
-    if(BSP_SDRAM_ReadData(SDRAM_WRITE_READ_ADDR + WRITE_READ_ADDR, sdram_aRxBuffer, BUFFER_SIZE) != SDRAM_OK) {
+    if (BSP_SDRAM_ReadData(SDRAM_WRITE_READ_ADDR + WRITE_READ_ADDR, sdram_aRxBuffer, BUFFER_SIZE) != SDRAM_OK) {
         BSP_LCD_DisplayStringAt(20, 160, (uint8_t *)"SDRAM READ : FAILED", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(20, 160, (uint8_t *)"SDRAM READ  : OK", LEFT_MODE);
     }
 
-    if(Buffercmp(sdram_aTxBuffer, sdram_aRxBuffer, BUFFER_SIZE) > 0) {
+    HAL_Delay(2000);
+
+    if (Buffercmp(sdram_aTxBuffer, sdram_aRxBuffer, BUFFER_SIZE) > 0) {
         BSP_LCD_DisplayStringAt(20, 190, (uint8_t *)"SDRAM COMPARE : FAILED", LEFT_MODE);
     } else {
         BSP_LCD_DisplayStringAt(20, 190, (uint8_t *)"SDRAM Test  : OK", LEFT_MODE);
@@ -75,7 +82,7 @@
     uint32_t tmpIndex = 0;
 
     /* Put in global buffer different values */
-    for (tmpIndex = 0; tmpIndex < uwBufferLenght; tmpIndex++ ) {
+    for (tmpIndex = 0; tmpIndex < uwBufferLenght; tmpIndex++) {
         pBuffer[tmpIndex] = tmpIndex + uwOffset;
     }
 }
@@ -87,7 +94,7 @@
   * @retval 1: pBuffer identical to pBuffer1
   *         0: pBuffer differs from pBuffer1
   */
-static uint8_t Buffercmp(uint32_t* pBuffer1, uint32_t* pBuffer2, uint16_t BufferLength)
+static uint8_t Buffercmp(uint32_t *pBuffer1, uint32_t *pBuffer2, uint16_t BufferLength)
 {
     while (BufferLength--) {
         if (*pBuffer1 != *pBuffer2) {
diff -r 6683ab395ac6 -r 0cfdd4157b1e mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Fri Nov 15 16:39:35 2019 +0100
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#699372421a3b388fe568e9be85b1a985749a438f
diff -r 6683ab395ac6 -r 0cfdd4157b1e mbed.bld
--- a/mbed.bld	Wed Jun 07 11:46:22 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/86740a56073b
\ No newline at end of file