cancel
Showing results for 
Search instead for 
Did you mean: 

STEVAL-STWINBX1 datalogger board - add digital input for logging to SD card (to sync multiple DAQs)

johngj
Senior

I am using the STEVAL-STWINBX1 development board and have downloaded the FP-SNS-DATALOG2 software to the board.

Is it possible to add another channel, in this case a digital input that will be logged to the SD card ?

I need to synchronize the data logs from different DAQ systems including the STEVAL-STWINBX1

I was thinking if the STEVAL-STWINBX1 could log a GPS PPS (Pulse Per Second) digital signal, then I could manually (offline) sync its log with the logs from the other DAQ systems.

Or is there some other technique I can use to synchronize all these logs from different DAQ systems (e.g. IRIG, NTP, EtherCAT, PTP).

 

 

 

 

16 REPLIES 16

Thanks Simone, I changed to bank 1 (using the iPhone app) and then flashed using the Segger J-Link and now the breakpoints now work correctly.  When I toggle the software tag (in the GUI tool) it now breakpoints as expected.

I thought that configuring an IO pin would be simple, but when try to open the ioc file I get the following error...

Invalid Input: Must be project's active .ioc file.

Project's 'STM32CubeFunctionPack_DATALOG2_V2.1.1' active one is 'STM32CubeFunctionPack_DATALOG2_V2.1.1.ioc' file

johngj_1-1720449393401.png

 

How do I resolve this ?

 

 

 

I managed to resolve this by using the CubeMx tool (as explained in the readme.html in the mx folder)

I configured pin PB1 as an external interrupt and generated the code...

johngj_0-1720520386569.png

In the generated code, I can see where the pin is initialised.

Where is the code for the external interrupt for this pin, or does this have to be manually implemented ?

I searched the project for EXTSYNC_EXTI_IRQn but its only defined in main.h...

johngj_1-1720520774921.png

I am using PB1 which is connected to pin 12 of the CN1 connector....

johngj_1-1720531276878.png

 

PB1 (pin 12) is connected to pin 15 of the DIL24 socket on the adapter board...

 

johngj_2-1720533319707.png

I have added a call back (in App_model.c) for the external interrupt.... 

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
  if(GPIO_Pin == GPIO_PIN_1) {
	  TMSetSWTag(0, 0);
  } else {
	  TMInitSWTagStatus(false, 0);
  }
}

 

I set a breakpoint at this external interrupt but its not halting when I ground PB1.

When I measure the voltage of pin 15 of the DIL24 socket I expect to see 3.3V as I enabled the internal pullup resistor, however it is reading 0V. 

Is PB1 being used by something else in the software ?

After HAL_GPIO_Init(EXTSYNC_GPIO_Port, &GPIO_InitStruct) is called, register GPIOMODER.MODE1 is 0x0 and PB1 is pulled up to 3.3V as expected....

johngj_5-1720536161773.png

 

johngj_4-1720535501101.png

But register GPIOMODER.MODE1 changes from 0x0 to 0x3 after __HAL_RCC_GPIOB_CLK_DISABLE() is called...

johngj_6-1720536219396.png

After running for a few seconds GPIOMODER.MODE1 then changes from 0x3 to 0x1...

johngj_7-1720537090558.png

 

 

Hello @johngj 

If I well understand, you succeeded in setting up an external hardware tag. Am I right?


@johngj wrote:

But register GPIOMODER.MODE1 changes from 0x0 to 0x3 after __HAL_RCC_GPIOB_CLK_DISABLE() is called...


__HAL_RCC_GPIOB_CLK_DISABLE() is intended for detaching the GPIO B route from the supply, so disabling your configuration.


@johngj wrote:

After running for a few seconds GPIOMODER.MODE1 then changes from 0x3 to 0x1...

 

I guess somewhere else the related __HAL_RCC_GPIOB_CLK_ENABLE() is invoked newly, thus enabling newly the GPIO B pins.

 

You have 2 choices: manually modify the code not to invoke the __HAL_RCC_GPIOB_CLK_DISABLE() anymore or move the GPIO initialization procedure you added just after the last __HAL_RCC_GPIOB_CLK_ENABLE() has been called.

 

Best regards

Simone

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I cannot get the external hardware tag to work, because port pin PB1 is being set as a digital output i.e. GPIOB->GPIO_MODER->MODE1 = 0x1

Step 1: PB1 is initially set as a digital input i.e. GPIOB->GPIO_MODER->MODE1 = 0x0

Step 2: The clock disable then changes this to GPIOB->GPIO_MODER->MODE1 = 0x3

Step 3: Something else then sets PB1 as as digital output i.e. GPIOB->GPIO_MODER->MODE1 = 0x1

johngj_1-1720620677995.png

 

It seems something else is already using port pin PB1 and setting it to an output ?

On the schematic, port pin PB1 goes to the expansion connector CN1 and has a net label GPIO1_EXT....

johngj_3-1720620818662.png

 

So is PB1 already used by something else in the software and over writing my request for it to be an input ?

I assume there something already in the software for when a sensor is connected to the expansion connector CN1  ?  

Or is there a different piece of software if the expansion connector CN1 is used ?

I've found where PB1 pin is being changed, it happens during the debug pin initialization, where the code appears to initialize all the pins on the expansion connector.

So I commented out line 161 and now GPIOB->GPIO_MODER->MODE1 remains set to 0x0 (i.e. an input)....

johngj_4-1720622623409.png

Pin PB1 is now at 3.3V as its configured to use the internal pull up resistor and is also set as an external interrupt with a falling edge

When I short PB1 to ground I can see the input data register  GPIOB->->GPIO_IDR->ID1 change state (0x1 when PB1 is floating and 0x0 when PB1 is grounded).

However, the code does not breakpoint in the external interrupt.  Have I implemented this external interrupt correctly (see below) ?

johngj_5-1720622918173.png

 

Do I need to consider anything about the ThreadX RTOS, or will the interrupt still work regardless ?

I configured PB1 in STM32 Cube MX as shown below...

johngj_6-1720625232263.png

 

But how do I find the name of the call back ?