2023-05-17 05:13 AM - last edited on 2023-09-01 09:21 AM by Amel NASRI
Hallo, since few days I am trying to run X-NUCLEO_PGEEZ1 board on NUCLEO-L476. I know, that:
I have tried everything (L476), changing SPI's for others, changing speed of SPI, other parameters, also connecting the board with separate wires (SPI2, SPI3). Nothing works correctly. (I know what sould be displayed, because I know how this PGEEZ1 sould work on f401 - I have run it with success).
On USART monitor I see only, that:
______Test 1 Starts______
Test case to verify Write Enable and Write Disable
20 : Failed
00 : Failed
00 : Passed
**************Test 1 Passed**************
______Test 2 Starts______
Test case to verify Page Write and Read
Maybe someone can give me an advice?
Regards, Paul
Solved! Go to Solution.
2023-05-25 06:30 AM
I have read that chapter before I wrote a message, so I thought, that when I will turn off and on the boards (Nucleo+PGEEZ1) with the reference project (I mean proper one, working in a moment before), everything will be fine. But it is not, that's why I perceive it as a different problem.
I understand the section 4.9 as: "whatever happenes, turning off and on the board/device will bring back the previous state, and I will be able to use the device.". Like oftern in electronics - make reset or turn off, everything will be fine again.
Maybe the try to write to "higher" page (above 8192) will cause such problems? I don't have how to check, both PGEEZ1 don't work.
Ok - now I'm preparing a project for using both: NUCLEO F476 and PGEEZ1, and I will send it to you as a attachement. The code contains init for i2c1 and usart3 . The project should be zipped as attachement in my message.
According to the documentation:
Chapter 1 page 3 line 6 says:
The devices offer two additional (identification) 512-byte pages: • The first contains identification data and, upon request, the UID. • The second can be used to store sensitive application parameters, which can (later) be permanently locked in read-only mode.
Chapter 2.2, page 6 says:
The device offers two additional (identification) 512-byte pages. The first contains identification data and, upon request, the UID. The second page can be used to store sensitive application parameters that can (later) be permanently locked in read-only mode.
Mybe there is a clue?
After making again the project, I see it still doesn't work.
The terminal shows:
______Test 1 Starts______
Test case to verify Write Enable and Write Disable
00 : Passed
02 : Passed
00 : Passed
**************Test 1 Passed**************
______Test 2 Starts______
Test case to verify Page Write and Read
Write Page : Failed
**************Test 2 Failed**************
The jumpers are ok, according to the chapter 2.5 "Board Setup" page 4 in UM3096. The boards (both PGEEZ1) are still useless.
2023-05-25 06:49 AM
Hi Paul,
Just want to check : I have edited my message and maybe you only saw the first one if you answer by email. I had a comment about your loop code, please have a look.
Maybe the try to write to "higher" page (above 8192) will cause such problems
==> No there is an rollover.
I'm going to check your code.
So if I understand correctly, the M95P32 is not working even if flash the firmware and start a project from scratch ?
Thomas
2023-05-25 06:53 AM
The M95P32 is not working even of I use fresh software from scratch.
2023-05-26 03:53 AM
Hallo again. I am very sorry for my late answer. I didn't answer for your first and second thought.
Ok - you wrote:
" I don't catch why you have the MX_SPI1_Init() and the MX_EEPROM_Init(). "
MX_EEPROM_Init() adds automaticaly, when Cube generates code for PGEEZ1 example. MX_EEPROM_Init() is code from file app_x-cube-eeprma1.c
void MX_EEPROM_Init(void)
{
MX_EEPROM_RW_Init();
IntroScreen();
}
Answer for second question: You wrote:
"when I look at your for loop :
for (i = 0; i<1000; i++) PGEEZ1_M95P32_WritePage(0, data_buff, i, 512);
You are currently writing 512 bytes at address 0, 1, 2, 3... instead of writing at address 0, 512, 1024, 1536.."
Of course, you are right. My mistake, Comes from bad habbits with older kind of memories, where you adressed only pages and recorded whole page instead of bytes... I Didn't read properly the datasheet.
Anyway, there is no reason to expect, that after reset, the M95P32 will not start, even with reference code.
2023-05-29 12:35 AM
Hi Paul,
I suggest you to send me the Nucleo board PGEEZ1. As you said there is no reason to expect the M95P32 not to work after a reset.
With your board I will be able to investigate much more easily.
My address is the following :
Thomas Llamazares
STMicroelectronics (Rousset) SAS,
190 avenue Celestin Coq, CS 60004 | 13106 ROUSSET | FRANCE
Thanks,
Thomas
2023-05-29 02:03 AM
I thought, that this issue will finalise with that proposal you made. Ok - before sending the boards to you, maybe you have any suggestions - to make the board work? Or some advices to search the problems by myself.
Because the scenario of stopping the proper work of that (two) boards was completly unexceptable for me (the boards stopped to work without reason, the code was the same moment before malfunction and there was no mechanical interference) - I start to think, that the device has a bug.
I will search for the problem a little, when I will find, I will share with community.
2023-05-29 02:11 AM
Hi Paul,
It is hard for me to solve the issue from distance. Maybe you can share some data like oscilloscope screenshot when you attempt to send data through the SPI bus.
We can also have a call if necessary.
Thomas
2023-05-29 02:12 AM
Good - I will try the oscliloscope option.
2023-06-20 02:35 AM
After some research, I think, that the problem is on my site. Copying binary file to F401 Nucleo with PGEEZ1 example makes it work properly. Compiling prepared project to F476 (there is no binary file to copy from ST) and adding some lines of code (for init and further testing) makes it work also. Here are the lines from main.c:
#include "main.h"
#include "app_x-cube-eeprma1.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "m95p32.h"
#include "pgeez1_m95p32.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
/* USER CODE BEGIN PTD */
/* USER CODE END PTD */
/* Private define ------------------------------------------------------------*/
/* USER CODE BEGIN PD */
/* USER CODE END PD */
/* Private macro -------------------------------------------------------------*/
/* USER CODE BEGIN PM */
/* USER CODE END PM */
/* Private variables ---------------------------------------------------------*/
SPI_HandleTypeDef hspi2;
/* USER CODE BEGIN PV */
uint8_t EEBuff[512];
uint8_t EEBuffRx[512];
uint16_t adress = 0;
int32_t retval32;
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_SPI2_Init(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_SPI2_Init();
// MX_EEPROM_Init();
/* USER CODE BEGIN 2 */
BSP_COM_Init(COM1);
while( PGEEZ1_M95P32_Init(PGEEZ1_M95P32_0)!= M95_OK); printf("\n\rInitiated ...");
retval32 = PGEEZ1_M95P32_WriteEnable(); printf("\n\rWrite Enabled...");
retval32 = PGEEZ1_M95P32_WritePage(0, EEBuff, adress, 512); printf("\n\rWrite OK ...");
retval32 = PGEEZ1_M95P32_ReadPage(0, EEBuffRx, adress, 512); printf("\n\rRead ...");
for (int i = 0; i<512; i++) if (EEBuff[i] != EEBuffRx[i]) printf("\n\rERROR");
printf("\n\rRead OK ...\n\r");
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
//MX_EEPROM_Process();
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
So - I the issue is solved.