Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:21 03 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Armmite L4: 48-pin support

     Page 1 of 2    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:17pm 30 Nov 2018
Copy link to clipboard 
Print this post

Please find attached version 5.05.01 which supports both 32-pin and 48-pin parts.

2018-11-30_230951_ArmmiteL4.zip

This is tested on a STM32L433CCT6 but will also run on STM32L431CCT6. The chip is mounted on an Adafruit 48-pin LQFP adapter . The chips are 0.5mm pitch so pretty easy to solder. I haven't tested all pin functionality but all MMBasic functionality works fine as does the SPI flash file system.



Pinout for the 48-pin chips is:

{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 1 VBAT
{ GPIOC, GPIO_PIN_13, DIGITAL_IN | DIGITAL_OUT, NULL, 0, "C13"}, // pin 2
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 3 OSC32_IN
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 4 OSC32_OUT
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 5 PH0
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 6 PH1
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 7 NRST
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 8 VSSA
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 9 VDDA
{ GPIOA, GPIO_PIN_0, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_5,"A0"}, // pin 10
{ GPIOA, GPIO_PIN_1, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_6,"A1"}, // pin 11 SPI-CLK
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 12 CONSOLE-TX

{ GPIOA, GPIO_PIN_3, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_8,"A3"}, // pin 13
{ GPIOA, GPIO_PIN_4, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_9,"A4"}, // pin 14 DAC-1
{ GPIOA, GPIO_PIN_5, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_10,"A5"}, // pin 15 DAC-2
{ GPIOA, GPIO_PIN_6, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_11,"A6"}, // pin 16 SPI-IN
{ GPIOA, GPIO_PIN_7, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_12,"A7"}, // pin 17 SPI-OUT
{ GPIOB, GPIO_PIN_0, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_15,"B0"}, // pin 18
{ GPIOB, GPIO_PIN_1, DIGITAL_IN | DIGITAL_OUT | ANALOG_IN , ADC1, ADC_CHANNEL_16,"B1"}, // pin 19 COUNT
{ GPIOB, GPIO_PIN_2, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B2"}, // pin 20
{ GPIOB, GPIO_PIN_10, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B10"}, // pin 21 COM2-TX
{ GPIOB, GPIO_PIN_11, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B11"}, // pin 22 COM2-RX
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 23 VSS
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 24 VDD

{ GPIOB, GPIO_PIN_12, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B12"}, // pin 25
{ GPIOB, GPIO_PIN_13, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B13"}, // pin 26
{ GPIOB, GPIO_PIN_14, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B14"}, // pin 27
{ GPIOB, GPIO_PIN_15, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B15"}, // pin 28
{ GPIOA, GPIO_PIN_8, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"A8"}, // pin 29
{ GPIOA, GPIO_PIN_9, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"A9"}, // pin 30 COM1-TX
{ GPIOA, GPIO_PIN_10, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"A10"}, // pin 31 COM2-RX
{ GPIOA, GPIO_PIN_11, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"A11"}, // pin 32
{ GPIOA, GPIO_PIN_12, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"A12"}, // pin 33 COM1-DE
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 34 SWDIO
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 35 VSS
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 36 VDD
//
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 37 SWCLK
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 38 CONSOLE-RX
{ GPIOB, GPIO_PIN_3, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B3"}, // pin 39 SPI2-CLK
{ GPIOB, GPIO_PIN_4, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B4"}, // pin 40 SPI2-IN
{ GPIOB, GPIO_PIN_5, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B5"}, // pin 41 SPI2-OUT
{ GPIOB, GPIO_PIN_6, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B6"}, // pin 42 I2C-SCL
{ GPIOB, GPIO_PIN_7, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B7"}, // pin 43 I2C-SDA
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 44 BOOT0
{ GPIOB, GPIO_PIN_8, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B8"}, // pin 45
{ GPIOB, GPIO_PIN_9, DIGITAL_IN | DIGITAL_OUT , NULL, 0,"B9"}, // pin 46
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 47 VSS
{ NULL, 0, PUNUSED , NULL, 0,""}, // pin 48 VDD

Edited by matherp 2018-12-01
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 01:31pm 30 Nov 2018
Copy link to clipboard 
Print this post

Hi matherp

Very good. Is it possibile to have USB as console on PA11/PA12 ?

AntonioEdited by sagt3k 2018-12-01
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:36pm 30 Nov 2018
Copy link to clipboard 
Print this post

  Quote  Is it possibile to have USB as console on PA11/PA12


No - not enough flash and I HATE usb consoles. They just create problems with embedded applications, particularly during development when frequent restarts are needed
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 02:43pm 30 Nov 2018
Copy link to clipboard 
Print this post

OK matherp

I did not know about these problems, so perfect like that.
When you have free time ..., do You have a simple schematic of how you are using this micro?

Thanks
Antonio
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 07:05am 02 Mar 2019
Copy link to clipboard 
Print this post

Hi matherp

Is there possibility to have software COM2 on L4-32pin?

Thanks
Antonio
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 08:20am 02 Mar 2019
Copy link to clipboard 
Print this post

  Quote  Is there possibility to have software COM2 on L4-32pin?


Not in the near future but I'll put it on the list to look at
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 12:49pm 19 Mar 2019
Copy link to clipboard 
Print this post

Hi matherp
I'm trying to work your firmware with a my old PCB for stm32l4x 48pin and STM32L431.
I have all the fundamentals pins connected with caps, res and crystal.
If try my simple firmware ports, uart, timer the micro works.
But If I try to put your firmware the micro seems blocked.
Apart boot0, nrst, do I need to take some precautions?
Thanks
AntonioEdited by sagt3k 2019-03-20
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:22pm 19 Mar 2019
Copy link to clipboard 
Print this post

From the manual which is nearing completion finally.

  Quote  Connect GND to pins 8, 23, 35, and 47
Connect 3.3V to pins 9, 24, 36, and 48
Tie BOOT0 (pin 44) to GND with a 10K resistor
Connect a low capacitance (12pf maximum) 32768Hz crystal between pins 3 and 4. Decouple both pins to GND with 12pf capacitors
Tie NRST (pin 7) to 3.3V with a 10K resistor
Decouple the 3.3V supply with 0.1uF capacitors close to pins 8 & 9, 23 & 24, 35 & 36, 47 & 48
Connect a USB/UART TX pin to STM32L4 pin 13
Connect a USB/UART RX pin to STM32L4 pin 12
Connect a USB/UART GND pin to GND
Connect VBAT (pin 1) to 3.3V or to a 3V battery which has a common ground with the rest of the circuit. Using a battery will keep the RTC accurate even if the rest of the circuit is powered off


The other thing worth trying is to disconnect the ST-LINK to make sure it isn't holding NRST.

Is your chip definitely a CC and not a CB? The CB is only 128K flash. The firmware would probably load but can't run.

Latest firmware (checked on a stm32l433cct6) attached

2019-03-19_232030_ArmmiteL4.zip
 
sagt3k

Guru

Joined: 01/02/2015
Location: Italy
Posts: 313
Posted: 01:37pm 19 Mar 2019
Copy link to clipboard 
Print this post

Thanks.
I have only STM32L431CCT6.is it ok with your firmware?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:43pm 19 Mar 2019
Copy link to clipboard 
Print this post

  Quote  I have only STM32L431CCT6.is it ok with your firmware?


Yes definitely. The reason I raise the CB/CC issue is that I bought CC of RS and they shipped CB which I only noticed when the firmware wouldn't run.
 
grumpyoldgeek
Newbie

Joined: 30/07/2018
Location: United States
Posts: 36
Posted: 06:58am 26 Apr 2019
Copy link to clipboard 
Print this post

Matherp,

Using the above design with the 32khz crystal, can the firmware be loaded through the serial port if BOOT0 is pulled up?
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:10am 26 Apr 2019
Copy link to clipboard 
Print this post

  Quote  Using the above design with the 32khz crystal, can the firmware be loaded through the serial port if BOOT0 is pulled up?


Yes: no problem
 
grumpyoldgeek
Newbie

Joined: 30/07/2018
Location: United States
Posts: 36
Posted: 08:21am 26 Apr 2019
Copy link to clipboard 
Print this post

Thanks. I've been trying to build a prototype similar to what you've done, but I don't see a waveform on the crystal terminals. I've double checked the wiring and tried 2 crystals and a ceramic resonator and I still get nothing. I'll try a new cpu next.
 
goc30

Guru

Joined: 12/04/2017
Location: France
Posts: 435
Posted: 01:32pm 26 Apr 2019
Copy link to clipboard 
Print this post

Hi Peter

question:
is-it possible to know speed of L4 as


print CPU 'question
> CPU speed : 80 'response

 
grumpyoldgeek
Newbie

Joined: 30/07/2018
Location: United States
Posts: 36
Posted: 12:32am 01 May 2019
Copy link to clipboard 
Print this post

Peter,

The ARMmite L4 manual says to ground pin 3 of the W25Q128JV flash memory chip. The datasheet for the part shows pin 3 grounded to write protect the part. Is this an error, or are you using a register inside the part to enable writes?

I also noticed in the STM32L433 datasheet that the NRST pin has an internal weak pullup, so a 10k pullup is probably unnecessary if the pin is not used otherwise.

I have everything working except the flash memory, which I have not connected yet. I spent a lot of time thinking my prototype was not working because I could not see any signals on the oscillator pins. It turns out that the unprogrammed part uses the internal oscillator and there is no signals on the pins until code turns on the oscillator.

 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 02:54pm 01 May 2019
Copy link to clipboard 
Print this post

  Quote  Is this an error, or are you using a register inside the part to enable writes?


From the W25Q128JV datasheet

SRP and SRL are zero so

"/WP pin has no control. The Status register can be written to
after a Write Enable instruction, WEL=1. [Factory Default] "

I think I just tied WP low for something to do with it but it could equally be high, just best practice not to leave it floating.
 
grumpyoldgeek
Newbie

Joined: 30/07/2018
Location: United States
Posts: 36
Posted: 03:36am 02 May 2019
Copy link to clipboard 
Print this post



Prototype is fully functional. A couple of notes, pin 2 on the L433 does not work for flash chip select, I ended up using pin 5. 32khz crystal is only active after loading firmware. When active, you should see a rough sine wave on pins 3 & 4 of about 120 millivolts. DO NOT waste your time trying to get the STM Serial Loader Demo to work, use the STMCube Programmer as the documentation says. It works great. Schematics will follow in a few days.
Edited by grumpyoldgeek 2019-05-03
 
grumpyoldgeek
Newbie

Joined: 30/07/2018
Location: United States
Posts: 36
Posted: 11:14pm 02 May 2019
Copy link to clipboard 
Print this post

I'm seeing a VBAT current draw of about 60 microamperes when VDD is removed. Is that normal? I need something closer to 2-3 microamperes for a coin cell.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:02am 03 May 2019
Copy link to clipboard 
Print this post

  Quote  I'm seeing a VBAT current draw of about 60 microamperes when VDD is removed. Is that normal?


No, should be approx 0.4uA
 
grumpyoldgeek
Newbie

Joined: 30/07/2018
Location: United States
Posts: 36
Posted: 06:14pm 03 May 2019
Copy link to clipboard 
Print this post

Peter,

I'm still having problems with VBAT current consumption. I've loaded firmware 2019-03019 and the processor behaves correctly in all other respects. I removed all components from the processor to insure that there are no sneak paths for parasitic current draw. All that is connected to it is the 32Khz crystal and its capacitors and a high quality meter capable of measuring tenths of micro-amperes which is in series with the coin cell and the VBAT pin. The circuit board has been meticulously cleaned.

I connect a coin cell to VBAT and apply 3.3 volts to Vdd. The processor works fine and the 32Khz oscillator is running. VBAT current is zero.

I remove the 3.3 volts and VBAT current is 0.3 micro-amperes. The oscillator is running.

I reapply 3.3 volts and then remove it. VBAT current goes up to 60 micro-amperes. Subsequent cycling of Vdd does not improve things. Neither does resetting by momentarily grounding NRST. The only way to get VBAT back to 0.3 micro-amperes is to remove both VBAT and Vdd and reapply them.

Any help you can give would be appreciated. I'd be happy to replace the processor chip if you think that might help. Edited by grumpyoldgeek 2019-05-05
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025