Giter Site home page Giter Site logo

stm32's Introduction

stm32

stm32's People

Contributors

avgorbi avatar jaseg avatar lonelywolf avatar xieyangxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stm32's Issues

errors

Hi there

i am using a stm32 and bmp180, and i already replace the old cmsis, but there are still many errors in the code, actually there are many undefined varablse in the startup.c. it might be some problem about the direction i have setted. but it a bit hard for me to find to debug.

Could you please share the workspace with bmp180? thank you so much.

Best wishes.

Linyu Cai

idea: make it easier to determine if radio is working at all

The problem: you have two boards and two nrf24l01 radios and you're trying to make them communicate.
And nothing seems to work. You check your code, wiring, experiment with changes here and there but no luck - no communication. Radios are set up to transmit and receive but nothing happens.
Now you have no idea what is wrong - is it the transmitter side or receiver side? Are the radios working at all? Maybe one is broken, but which one? Or is it software? Or wiring?
Basically you have no idea where the problem may be. Or it worked yesterday but today doesnt work and you have no idea why. You try to find a problem but where to start? There's no indication which radio works and which doesnt, software doesnt report any problems, so without any specialized equippment you can only guess.
So my suggestion is to add some diagnostic function to the library - check if we're talking to the hardware at all, check if it responds in expected way, if there are some transmission attempts, even unsuccessful - report it - some sanity check protocol - and try to extract as much information as possible.

Issue with the way that the nrf24l01 library writes the address

At the moment the nrf24l01 library writes the address in reverse order compared to the Arduino library which makes it incompatible unless you specify the address in reverse order.

void nRF24_SetAddr(uint8_t pipe, const uint8_t *addr) {
	uint8_t addr_width;

	// RX_ADDR_Px register
	switch (pipe) {
		case nRF24_PIPETX:
		case nRF24_PIPE0:
		case nRF24_PIPE1:
			// Get address width
			addr_width = nRF24_ReadReg(nRF24_REG_SETUP_AW) + 1;
			// Write address in reverse order (LSByte first)
			addr += addr_width;
			nRF24_CSN_L();
			nRF24_LL_RW(nRF24_CMD_W_REGISTER | nRF24_ADDR_REGS[pipe]);
			do {
				nRF24_LL_RW(*addr--);
			} while (addr_width--);
			nRF24_CSN_H();
			break;
		case nRF24_PIPE2:
		case nRF24_PIPE3:
		case nRF24_PIPE4:
		case nRF24_PIPE5:
			// Write address LSBbyte (only first byte from the addr buffer)
			nRF24_WriteReg(nRF24_ADDR_REGS[pipe], *addr);
			break;
		default:
			// Incorrect pipe number -> do nothing
			break;
	}
}

is how it is currently done which makes it incompatible with nrf24 modules connected up to an Arduino.

void nRF24_SetAddr(uint8_t pipe, const uint8_t *addr) {
	uint8_t addr_width;

	// RX_ADDR_Px register
	switch (pipe) {
		case nRF24_PIPETX:
		case nRF24_PIPE0:
		case nRF24_PIPE1:
			// Get address width
			addr_width = nRF24_ReadReg(nRF24_REG_SETUP_AW) + 1;
			nRF24_CSN_L();
			nRF24_LL_RW(nRF24_CMD_W_REGISTER | nRF24_ADDR_REGS[pipe]);
			//Write the address
			for(int x = 0; x < addr_width; x++){
				nRF24_LL_RW(*addr++);
			}
			nRF24_CSN_H();
			break;
		case nRF24_PIPE2:
		case nRF24_PIPE3:
		case nRF24_PIPE4:
		case nRF24_PIPE5:
			// Write address LSBbyte (only first byte from the addr buffer)
			nRF24_WriteReg(nRF24_ADDR_REGS[pipe], *addr);
			break;
		default:
			// Incorrect pipe number -> do nothing
			break;
	}
}

fixes it, I haven't tried it with pipes 2->5 though.

codebase

Hey lonelywolf,

I'm making some STM32F030 examples where i used your code.
Because you are using the STM32F1, and i am using the STM32F0 the code is very different.
But i'm using the BMP180 registers and stuff. I know that's not your invention, because it's actually from bosch.
I just want to give you credit for your work, and i just don't know how to do it.
What can you agree upon as reference in my BMP180 code ?

Greetings,
Robbe

What is the code license ?

Hello Dmitry,

I downloaded and modified your nRF24 library. A summary of changes is below and the code is attached. I would like to know your original license, as it is not specified in the project.

If possible, I want to release it together my modifications using some BSD like license.

My modifications in the original code base are:

nrf24.c/.h

  • support for ACK frames with user data payload
  • support for feature register
  • some enumerations were transformed in types for later usage in my application
  • support for interrupts (my default mode of operation)

nrf24_hal.c/.h

  • support for the latest ST HAL API
  • interrupt support

I created a nrf24_app.h/.c where user can choose between two communication scenarios:

  1. unidirectional, PRX does not send anything but automatic ACK is enabled
  2. bidirectional, where PRX sends a response using the ACK+PAYLOAD features

Users can choose between scenarios and set if they want to be PTX or PRX. Callbacks are provided for tx and rx operations (see main.c). It is easy to use.

nrf24.zip

nRF24_ReadPayload for Dynamic Payload

In function nRF24_ReadPayload:
*length = nRF24_ReadReg(nRF24_REG_RX_PW_P0 + pipe);
It works only for fixed size payload.
I suggest replacing with:
*length = nRF24_ReadReg(CMD_R_RX_PL_WID);
This will work for both fixed size and dynamic.

ls027b7dh01 blank display

When ls027b7dh01 was tested with an LS044Q7DH01 display, the display was blank, It worked when the SPI baud rate was reduced from 16MHz (2MHz fSCLK) to 1.6MHz (1MHz fSCLK). The typical fSCLK frequency is 1MHz and maximum is 2MHz from the LS044Q7DH01 datasheet.

Also the SPI configuration in main.c is hardcoded to use SPI2, rather than use the configuration from the header file.

#if (SPI1_USE)
	SPI1_HandleInit();
#endif
#if (SPI2_USE)
	SPI2_HandleInit();
#endif
#if (SPI3_USE)
	SPI3_HandleInit();
#endif
	SPI_Init(&SMLCD_SPI_PORT, SPI_CLK_PL_E1, SPI_DIR_TX);
	SPI_SetDataWidth(&SMLCD_SPI_PORT, SPI_DW_8BIT);
	SPI_SetRXFIFOThreshold(&SMLCD_SPI_PORT, SPI_RXFIFO_THQ);
	//SPI_SetBaudrate(&hSPI2, Clock_SPICalcDivider(&hSPI2, 16000000));
	SPI_SetBaudrate(&SMLCD_SPI_PORT, Clock_SPICalcDivider(&hSPI2,     16000000/10));
	SPI_Enable(&SMLCD_SPI_PORT);

error in delay function

Delay_Init does not defined in delay.c and also it need to define this constants and variables

#define DELAY_TICK_FREQUENCY_US 1000000 /* = 1MHZ -> microseconds delay /
#define DELAY_TICK_FREQUENCY_MS 1000 /
= 1kHZ -> milliseconds delay */

static __IO uint32_t TimingDelay; // __IO -- volatile

Don't do check for TRUE or FALSE at this place

while (!I2C_CheckEvent(I2C_PORT,I2C_EVENT_MASTER_MODE_SELECT)); // Wait for EV5

Please, for compatibility with different stm32 microcontrollers, replace this check with the following:
while (I2C_CheckEvent(I2C_PORT,I2C_EVENT_MASTER_MODE_SELECT)==ERROR);

For stm32f4 ErrorStatus defined as:

typedef enum 
{
  ERROR = 0U, 
  SUCCESS = !ERROR
} ErrorStatus;

Please do this in all your code

The usb-mic project hard fault

I'm trying to run the usb-mic project on a Nucleo-L4R5Zi board. I created an empty project for this board in STM32CubeIDE and drag/dropped the files into the project. It builds OK but I hit a hard fault in system init on the line:
RCC->CR |= (uint32_t)0x00000100;

I suspect the problem is with how I'm building it. Are there instructions on building this, or an updated project for the STM32CubeIDE?

Any guidance is greatly appreciated.

nrf24l01

hello and thank you for these great libraries

how can I send data by nrf24l01 in this library ?

I use this code but always gives me UnSuccess & UnSuccess nRF24_MASK_MAX_RT

nRF24_TXMode();
Delay_ms(10);

           status = nRF24_TXPacket(txBuf,TX_PAYLOAD);
        if (status & nRF24_MASK_TX_DS)
        {
            UART_SendStr("---SEND-->>> Success\n");

        } else if (status & nRF24_MASK_MAX_RT)
        {
          UART_SendStr("---SEND-->>> UnSuccess nRF24_MASK_MAX_RT\n");
        } else
        {
             UART_SendStr("---SEND-->>> UnSuccess \n");
        }

wrong time DS3231

Hello,

wonderful code, well done.
There should be a small correction at The function "to Human readable Format"

hrf_date->Hours = raw_date->hours;
and
hrf_date->Year = raw_date->year + 2000;

otherwise both are in hexadecimal :)
So my 2016 was 2010 with your code.

Maybe I messed up...but check yourself again because we are in the hex overflow year 16 :D

Stm32f103c8t6 DMA

How to use dma.h in Arduino using stm32f103c8t6 plz provide some examples thnx in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.