Git Product home page Git Product logo

libstm8's People

Stargazers

 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

libstm8's Issues

sdcclib is deprecated, use sdar instead

In lib/l/Makefile line 9, "sdcclib" is used to generate the .lib file. However, it's been deprecated and replaced with "sdar -rc".
Line 9 should be:

sdar -rc ../stm8.lib $(OBJECTS)

STM8 UART Transmitting problem

Hello,

I am using the stm8l151... mcu and I am trying to send different strings via Uart1 to HTerminal. I have three different strings to send. The first two strings are transmitted completely but when the third one is being sent, it is truncated and it starts to send the first and second string again and repeatedly but when I go through the code step by step, it works the right way.

I have attached the output from Hterm (uart_com) for better understanding and also some parts of my code(uart transmit and uart_init)

Just for better understanding of the attached output, the strings(cmd 1, 2 and 3) are at+nrb, at+cfun=1, and at+cops=1,2,"26201"

Please Any suggestion will be greatly appreciated.๐Ÿ˜Š

uart_com

`void nbiot_buf_transmit(void){
PAL_UART1_RX_DISABLE();
PAL_UART1_TX_ENABLE();

  for(int i=0 ; i < sizeof(cmd1);i++){
 
    
    USART_SendData8(USART1,((uint8_t)cmd1[i]));
   while(!(USART1->SR));
     while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);

}

for(int i=0 ; i < sizeof(cmd2);i++){

    USART_SendData8(USART1,((uint8_t)cmd2[i]));
       while(!(USART1->SR));
     while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);

}

for(int i=0 ; i < sizeof(cmd3);i++){

    USART_SendData8(USART1,((uint8_t)cmd3[i]));
        while(!(USART1->SR));
     while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);

}`

`void uart_init(void){
/* init Tx and Rx Pins /
GPIO_Init(GPIOC, GPIO_Pin_3, GPIO_Mode_Out_PP_High_Fast); //tx pin output
GPIO_Init(GPIOC, GPIO_Pin_2, GPIO_Mode_In_FL_No_IT); //rx pin input
/
enable usart1 clk /
(CLK->PCKENR1 |= (uint8_t)((uint8_t)1 << ((uint8_t)CLK_Peripheral_USART1 & (uint8_t)0x0F)));
/
config for GPIO mode */
(CLK->PCKENR2 |= (uint8_t)((uint8_t)1 << ((uint8_t)CLK_Peripheral_COMP & (uint8_t)0x0F)));
(RI->IOCMR3 &= 0xFD);
(RI->IOSR3 &= (uint8_t) (~(uint8_t) ((uint8_t)1 << (uint8_t) (RI_IOSwitch_6 & (uint8_t) 0x0F))));

(CLK->PCKENR2 &= (uint8_t)(~(uint8_t)(((uint8_t)1 << ((uint8_t)CLK_Peripheral_COMP & (uint8_t)0x0F)))));

/* init usart peripheral /
USART_Init(USART1,
(PAL_dwCLK_FREQ_VALUE/9600),
USART_WordLength_8b,
USART_StopBits_1,
USART_Parity_No,
USART_Mode_Rx); //Rx enable
ITC->ISPR8 &= 0xFC; // Set USART1_RX_IRQn on ITC_PriorityLevel_2
ITC->ISPR7 &= 0x3F; // Set USART1_TX_IRQn on ITC_PriorityLevel_2
/
enable usart1 peripheral */
USART_Cmd(USART1,ENABLE);

}`

This is a library, but license is GPL

I was looking to fork / improve this code, and extend it for use with other micros in the STM8 family, but this project is currently licensed GPL.

As such. any use of this code in a project will require licensing of any and all other code to be GPL to be compliant. This is fine for hobbyist or personal use, but for actual embedded product development this should not be a forced decision. Also, this is a library, and the GPL is a poor license choice for libraries (unless, of course, the goal is to further push GPL).

The library you wish to emulate, libopencm3, is LGPL. That is also problematic for embedded software as libraries usually aren't linked, though they have shown interest in adding a linking exception.

Is there any reason this project is licensed GPL, and if none in particular, could it be relicensed to something either more liberal (MIT, BSD, etc) or something more embedded-friendly?

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.