Skip to content

Discovery L072CZ-LRWAN1 support #151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

knielsen
Copy link
Contributor

This pull request adds support for the Discovery L072CZ-LRWAN1 board:

http://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html

Pins A1/A3/A4/A5 are no connect by default, but could be used by
closing solder bridges.
The LED_BUILTIN on Arduino pin D13 is LD2, and it is green, not red as
the user manual says.

Also add LED_LD[1234] defines to match the markings on the PCB.
@fpistm
Copy link
Member

fpistm commented Nov 14, 2017

Thanks @knielsen
I will have a look soon.

@fpistm fpistm self-requested a review November 14, 2017 13:36
@fpistm fpistm added enhancement New feature or request new variant Add support of new bard labels Nov 14, 2017
@LMESTM
Copy link
Member

LMESTM commented Nov 15, 2017

@knielsen Looks great thanks for the PR ! Any plan on your side to add a LORA library for this board ?

@knielsen
Copy link
Contributor Author

Sorry, no plans for a LoRa library from me currently...

@fpistm
Copy link
Member

fpistm commented Nov 21, 2017

Thanks @knielsen for this variant.
I've made some tests and it's ok.
I've only made some cosmetic update in #156.
LD2 is set to red in the schematics but well set to green in the 'Table 4. Assignment of the control ports'
I've added DIS_L072Z as a possible node value.

Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this variant.
I've make a new PR with all fixes and some cosmetic update (squash, indentation,...) here: #156

# DISCO-L072CZ-LRWAN1 board
# Support: Serial1 (USART1 on PA10, PA9) and Serial=Serial2 (connected to ST-LINK)
Disco.menu.pnum.DISCO_L072CZ_LRWAN1=Discovery L072CZ-LRWAN1
Disco.menu.pnum.DISCO_L072CZ_LRWAN1.node=NODE_L072CZ
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added DIS_L072Z as a possible node value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

// {PB_4, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1 - Not available on board
// {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - Not available on board
// {PB_5, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2
{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM3, 2, 0)}, // TIM3_CH2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems TIM3 on this pin do not work. I've tried TIM22 it is ok.
I've debugged but see nothing wrong. I've tried TIM3 with the Servo and it is ok.
I saw in errata sheet an issue with TIM3_ER on other pin but not on this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, thanks for testing this.
TIM22 is TIMER_TONE in variant.h, but not sure that will necessarily be a problem.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a pb. 😉

An third analog/ADC input is available as A6 on the PA5 pin.

SPI MOSI and MISO are available on digital pins D11 and D12, but the
SCK pin is D3 (unlike Arduino Uno where it is on D13).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default SB2 is closed so D13 is connected to PB13 like D3. So SCK is also on D13.
I've tested SPI and it is ok with D13

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good that you found this from test. The user manual said SB2 is OFF by default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes user manual has some errors. I will raise issue internally to correct those one

PB_6, //D10
PB_15, //D11
PB_14, //D12
PA_5, //D13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D13 is PB13

PB6, //D10
PB15, //D11
PB14, //D12
PA5, //D13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D13 is PB13

#define SS3 8
#define MOSI 11
#define MISO 12
#define SCK 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As D13 is equal to D3 I've revert to 13

//Timer Definitions
//Do not use timer used by PWM pins when possible. See PinMap_PWM.
#define TIMER_TONE TIM22
#define TIMER_UART_EMULATED TIM21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the TIMER_UART_EMULATED as it need to be reviewed. (move as SoftwareSerial library)

@LMESTM
Copy link
Member

LMESTM commented Nov 23, 2017

@knielsen

Sorry, no plans for a LoRa library from me currently...

No problem, this is good to know anyway to avoid any parallel developments - thanks again for your contribution.

@knielsen
Copy link
Contributor Author

Looks great @fpistm , thanks!

@fpistm fpistm self-assigned this Nov 24, 2017
@fpistm fpistm added the duplicate This issue or pull request already exists label Nov 24, 2017
@fpistm
Copy link
Member

fpistm commented Nov 24, 2017

This PR has been merged thanks #156

@fpistm fpistm closed this Nov 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request new variant Add support of new bard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants