Comments (5)
Hi @mytechnotalent ! What communication channel did you use in your unittest_transport.c
?
from platformio-examples.
#include "unittest_transport.h"
#include "stm32f4xx_hal.h"
#define USARTx USART2
#define USARTx_CLK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE()
#define USARTx_CLK_DISABLE() __HAL_RCC_USART2_CLK_DISABLE()
#define USARTx_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define USARTx_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE()
#define USARTx_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define USARTx_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOA_CLK_DISABLE()
#define USARTx_FORCE_RESET() __HAL_RCC_USART2_FORCE_RESET()
#define USARTx_RELEASE_RESET() __HAL_RCC_USART2_RELEASE_RESET()
#define USARTx_TX_PIN GPIO_PIN_2
#define USARTx_TX_GPIO_PORT GPIOA
#define USARTx_TX_AF GPIO_AF7_USART2
#define USARTx_RX_PIN GPIO_PIN_3
#define USARTx_RX_GPIO_PORT GPIOA
#define USARTx_RX_AF GPIO_AF7_USART2
static UART_HandleTypeDef UartHandle;
void unittest_uart_begin()
{
GPIO_InitTypeDef GPIO_InitStruct;
USARTx_TX_GPIO_CLK_ENABLE();
USARTx_RX_GPIO_CLK_ENABLE();
USARTx_CLK_ENABLE();
GPIO_InitStruct.Pin = USARTx_TX_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
GPIO_InitStruct.Alternate = USARTx_TX_AF;
HAL_GPIO_Init(USARTx_TX_GPIO_PORT, &GPIO_InitStruct);
GPIO_InitStruct.Pin = USARTx_RX_PIN;
GPIO_InitStruct.Alternate = USARTx_RX_AF;
HAL_GPIO_Init(USARTx_RX_GPIO_PORT, &GPIO_InitStruct);
UartHandle.Instance = USARTx;
UartHandle.Init.BaudRate = 115200;
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_NONE;
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UartHandle.Init.Mode = UART_MODE_TX_RX;
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
if(HAL_UART_Init(&UartHandle) != HAL_OK) {
while(1){}
}
}
void unittest_uart_putchar(char c)
{
HAL_UART_Transmit(&UartHandle, (uint8_t*)(&c), 1, 1000);
}
void unittest_uart_flush(){}
void unittest_uart_end() {
USARTx_CLK_DISABLE();
USARTx_RX_GPIO_CLK_DISABLE();
USARTx_TX_GPIO_CLK_DISABLE();
}
Not clear exactly on what channel so I pasted everything.
from platformio-examples.
@valeros
unittest_transport.h
is saying include file not found in browse path.
test
test_main.c
unittest_transport.c
unittest_transport.h
That is where it is placed is it in the wrong place?
from platformio-examples.
Even with unittest_transport.h
put in include
dir now the error goes away but same result.
> Executing task: C:\Users\kevin\.platformio\penv\Scripts\platformio.exe test --environment disco_f407vg <
Verbose mode can be enabled via `-v, --verbose` option
Collected 1 items
Processing * in disco_f407vg environment
------------------------------------------------------------------------------------------------------------Building...
C:\Users\kevin\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smbus.c: In function 'SMBUS_MasterTransmit_TXE':
C:\Users\kevin\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smbus.c:1928:12: warning: unused variable 'CurrentMode' [-Wunused-variable]
uint32_t CurrentMode = hsmbus->Mode;
^~~~~~~~~~~
C:\Users\kevin\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smbus.c: In function 'SMBUS_Master_ADDR':
C:\Users\kevin\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smbus.c:2272:12: warning: unused variable 'CurrentXferOptions' [-Wunused-variable]
uint32_t CurrentXferOptions = hsmbus->XferOptions;
^~~~~~~~~~~~~~~~~~
C:\Users\kevin\.platformio\packages\framework-stm32cubef4\Drivers\STM32F4xx_HAL_Driver\Src\stm32f4xx_hal_smbus.c:2271:12: warning: unused variable 'CurrentMode' [-Wunused-variable]
uint32_t CurrentMode = hsmbus->Mode;
^~~~~~~~~~~
Uploading...
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.11.0-00155-ge392e485e (2021-03-15-16:44)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080003bc msp: 0x20020000
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
Testing...
If you don't see any output for the first 10 secs, please reset board (press reset button)
Hangs and does not do the unittests.
from platformio-examples.
That tutorial was written for Nucleo-F401RE which has a completely different schematic, so it won't work with your board, mainly because the ST-LINK VCP on the Disco-F407VG board is not even connected to the MCU. I see here two options:
- Solder the ST-LINK VCP pins to any available UART pins on your board and rewrite the
unittest_transport.c
to use that UART. - Use an external USB-UART converter, connect it to any available UART pins and rewrite the
unittest_transport.c
to use that UART.
from platformio-examples.
Related Issues (20)
- Error: No such command "device" HOT 1
- Problem with platform.io and ArduinoOTA (Example BasicOTA.ino) HOT 3
- Providing examples for OTA firmware updates without authentication is dangerous and irresponsible. HOT 2
- ** [upload] /dev/ttyACM0/firmware.bin: Not a directory HOT 2
- AtmelAVR: Broken example links HOT 1
- Can't compile LCD Example using Platform IO, Blink and Hello World work just fine. HOT 2
- Wifi Scan HOT 2
- Unit testing examples conveniently omit the fact that IT COSTS MONEY TO UNIT TEST HOT 9
- F1 libs are unusable HOT 1
- platformio-examples "Blink" doesn't work HOT 1
- unity.h libraty for unit testing is not compiling HOT 1
- Understanding the test harnesses HOT 1
- Hexadecimal print display problem HOT 5
- arduino-mock does not compile with platformio 4.1.0 HOT 6
- need good first example for unit testing HOT 2
- Question of debug Unit testing program. HOT 3
- UnitTesting example calculator file/folder layout seems only to work with single component in native and embedded environment HOT 6
- Potential null pointer dereference in interrupt handler HOT 5
- Esp8266 OTA - No answer after sending invitation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from platformio-examples.