2024-06-20 06:12 AM - last edited on 2024-06-28 01:13 AM by SimonePradolini
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).
2024-07-08 07:37 AM
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
How do I resolve this ?
2024-07-09 03:30 AM
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...
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...
2024-07-09 07:02 AM
I am using PB1 which is connected to pin 12 of the CN1 connector....
PB1 (pin 12) is connected to pin 15 of the DIL24 socket on the adapter board...
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 ?
2024-07-09 07:47 AM - edited 2024-07-09 07:58 AM
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....
But register GPIOMODER.MODE1 changes from 0x0 to 0x3 after __HAL_RCC_GPIOB_CLK_DISABLE() is called...
After running for a few seconds GPIOMODER.MODE1 then changes from 0x3 to 0x1...
2024-07-10 03:33 AM
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
2024-07-10 07:10 AM - edited 2024-07-10 07:16 AM
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
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....
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 ?
2024-07-10 07:51 AM - edited 2024-07-10 08:28 AM
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)....
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) ?
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...
But how do I find the name of the call back ?