Author Topic: PIC32MX vs STM32L4, my first impression  (Read 10834 times)

0 Members and 1 Guest are viewing this topic.

Offline KarelTopic starter

  • Super Contributor
  • ***
  • Posts: 2217
  • Country: 00
PIC32MX vs STM32L4, my first impression
« on: August 02, 2018, 09:33:06 am »
So far, we have been using PIC32MX mcu's. Now, for a battery powered application, we are investigating to switch to STM32L4.
I just wanted to share my first impressions while using the NUCLEO-L452RE:

nice:
1. cheap development/starter boards and programmer

pro's:
2. adjustable speed for output pins to control emi  :-+

annoying/confusing:
1. enable clock should be named enable power
2. almost all examples uses hal

con's:
1. no hardware fifo for usart  :palm:
2. no possiblity for a delayed sample clock for spi rx data (to overcome the delay when using isolators at high clockspeed)  :--

I bought the book "Mastering STM32" but it was almost useless to me. It should be titled "Mastering HAL" instead.
Also, the guide to setup the toolchain didn't work for me or wasn't convenient.

I ended up using System Workbench (which worked out of the box) and CMSIS but no HAL.
The learning curve was a bit steep but once I had a working test project using GPIO, USART, interrupts, SPI, I feel confident that the hardest part has passed.

 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: PIC32MX vs STM32L4, my first impression
« Reply #1 on: August 02, 2018, 10:02:55 am »
If you want a general book on the Cortex-M core, I recommend "The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors" by Joseph Yiu, but it sounds like you got over the initial hump.

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: PIC32MX vs STM32L4, my first impression
« Reply #2 on: August 02, 2018, 02:30:58 pm »
con's:
1. no hardware fifo for usart  :palm:
A "feature" of the STM32F4 family (different from L4) is that the DMA controllers contain FIFOs. I always assumed this was a design choice by ST that meant you basically had to implement drivers with DMA to avoid losing data.

But the L4 reference manual doesn't mention these FIFOs, so maybe they decided that "direct mode" DMA is fast enough for everything.

Opinions vary on whether the HAL is good or evil. I like the LL APIs personally--just a thin layer over the registers themselves.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8170
  • Country: fi
Re: PIC32MX vs STM32L4, my first impression
« Reply #3 on: August 02, 2018, 03:43:16 pm »
What baud rates are you thinking about?

Most STM32 devices offer a FIFO on the DMA side, except the simplest ones - even then, DMAing directly to SRAM shouldn't be a problem you face too often.

Adding another FIFO on the USART side makes only sense with very high baudrates, or a very congested bus, i.e., other very high data rate devices being DMA'ed somewhere.

I can see that the new STM32H7 adds FIFOs to the USARTs, but that's a high end device.

The digital camera interface, for example, always has a FIFO in the peripheral side as well.

 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: us
Re: PIC32MX vs STM32L4, my first impression
« Reply #4 on: August 02, 2018, 04:27:22 pm »
1. enable clock should be named enable power

Perhaps a minor quibble, but this is not correct.  It is in fact the clock which is being enabled when you "turn on" the peripheral, so they are using the right terminology.  Power is always applied to the peripheral regardless of whether the ____EN bit is set in, e.g., the APB2ENR register.  (Some fancier MCUs have power domains in addition to clock domains, and allow you to gate power as well as clock.)
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: PIC32MX vs STM32L4, my first impression
« Reply #5 on: August 02, 2018, 06:21:33 pm »
 
Have you considered the new NXP RT1020?, A Cortex M7 at 500Mhz, very cheap and easy to use. Can boot from SD or external QSPI to the microcontroller, with which you have much more program memory (from 16 Megabytes for QSPI and Gigas for SD).

https://www.mouser.es/Search/Refine.aspx?Keyword=RT1020&Ns=Pricing%7C0&FS=True
https://www.nxp.com/products/processors-and-microcontrollers/applications-processors/i.mx-applications-processors/i.mx-rt-series/i.mx-rt1020-crossover-processor-with-arm-cortex-m7-core:i.MX-RT1020

MCUXpresso, which is the NXP editor, includes the Config Tools as an assistant to configure everything (it's like Cubemx for STM32), and the SDK brings many examples of source code to use all the peripherals.

I worked with PIC32MX first, then with STM32F4, later I switched to Kinetis from NXP, and now I'm working to migrate everything to RT1020 from NXP. Except for the PIC32MX, all with ARM.
« Last Edit: August 02, 2018, 06:29:04 pm by luiHS »
 
The following users thanked this post: Muxr, MT

Online iMo

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: pm
  • It's important to try new things..
Re: PIC32MX vs STM32L4, my first impression
« Reply #6 on: August 02, 2018, 06:46:15 pm »
Quote
Have you considered the new NXP RT1020?, A Cortex M7 at 500Mhz,
It is a flashless chip, isnt it?
Is 256kB of sram enough when not having an wide-bus-access to a flash?
Any practical experience with that?
« Last Edit: August 02, 2018, 06:48:06 pm by imo »
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: PIC32MX vs STM32L4, my first impression
« Reply #7 on: August 02, 2018, 07:23:52 pm »
Quote
Have you considered the new NXP RT1020?, A Cortex M7 at 500Mhz,
It is a flashless chip, isnt it?
Is 256kB of sram enough when not having an wide-bus-access to a flash?
Any practical experience with that?


The NXP i.MX RT series does not include internal flash for the program. You can use an SD card (4 bit parallel), a QSPI memory or a parallel Hyperflash (in the RT1050 and RT1060), to store and boot the program.

I'm testing right now, which option is ideal with the RT1020, a 64/128 Mbit QSPI or micro SD card. The RT1050 and RT1060, are only available in BGA, so I have discarded them for my designs, for now, because I design, manufacture and assemble my own products, and for now I prefer to do everything with LQFP.

In any case it is very cheap, we have the microcontroller for a price between 4 and 5 euros for quantities of 25 to 100 pieces and a QSPI flash of 64 or 128 Mbit that has a price of just over 1 euro in Mouser, and surely a lot cheaper in the Chinese. All that in the prices of the European distributor, the micro in Chinese is still expensive, but the QSPI memories are cheaper.

https://www.mouser.es/ProductDetail/870-25LP064A-JBLE
https://www.mouser.es/ProductDetail/870-IS25LP128F-JBLE
« Last Edit: August 02, 2018, 07:29:34 pm by luiHS »
 

Online iMo

  • Super Contributor
  • ***
  • Posts: 4778
  • Country: pm
  • It's important to try new things..
Re: PIC32MX vs STM32L4, my first impression
« Reply #8 on: August 02, 2018, 07:29:39 pm »
Pls post your experience then, I've been curious about whether the program memory throughput via QSPI is somehow on par with standard built-in flash in practical use. Thanks.
 

Offline mark03

  • Frequent Contributor
  • **
  • Posts: 711
  • Country: us
Re: PIC32MX vs STM32L4, my first impression
« Reply #9 on: August 02, 2018, 09:13:39 pm »
Quote
Have you considered the new NXP RT1020?, A Cortex M7 at 500Mhz,
It is a flashless chip, isnt it?
Is 256kB of sram enough when not having an wide-bus-access to a flash?
Any practical experience with that?
I assume OP chose STM32L4 for low power.  I have not crunched the numbers but iMX RT may be competitive at comparable clock speeds and using the built-in DC-DC converter.  However, you would definitely want to load the program code from QSPI into RAM at boot-up and run exclusively from RAM.  Running from external flash is either slow (w.r.t. internal flash), or very high power (again w.r.t. internal flash), or both.
 

Offline MT

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: aq
Re: PIC32MX vs STM32L4, my first impression
« Reply #10 on: August 02, 2018, 11:12:18 pm »
Have you considered the new NXP RT1020?,

Hmm, its cheaper then most F4's.  How do one develop with the RT1020? Is it via ROM code and USB or like ST a SWD/SCK/NRST dongle?
« Last Edit: August 02, 2018, 11:22:55 pm by MT »
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: PIC32MX vs STM32L4, my first impression
« Reply #11 on: August 03, 2018, 12:44:47 am »
Have you considered the new NXP RT1020?,

Hmm, its cheaper then most F4's.  How do one develop with the RT1020? Is it via ROM code and USB or like ST a SWD/SCK/NRST dongle?

If you work with the MIMXRT1020-EVK evaluation board, it has a Kinetis microcontroller with OpenSDA, which allows you to load the program and make Debug via USB (the Kinetis acts as an intermediary to program and debug).

The boot memory is selected with some jumpers on the board, for the RT1020 to choose between QSPI and SD, for the RT1050 it can be loaded in SD, QSPI and Hyperflash parallel.

For production, you can load the program using USB OTG or UART by connecting the microcontroller to a PC computer, running the MFG Tool software that NXP provides. In this case, an intermediary chip is not needed, and debugging I guess it can be done by SWD, I have not tried it yet.

For now I am testing everything with the evaluation board, and loading the programs using OpenSDA from the board, either by USB, or better with a Jlink or Multilink PE programmer by JTAG.
« Last Edit: August 03, 2018, 12:50:31 am by luiHS »
 
The following users thanked this post: MT

Offline MT

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: aq
Re: PIC32MX vs STM32L4, my first impression
« Reply #12 on: August 03, 2018, 01:10:12 am »
I was surprised EVK is 2 layer and has 133Mhz SDRAM i assumed 4 layers would be needed. I need to debug in ongoing development board. JLINK base seams to support MCUXpresso but expensive, do EVK have break out for SW interface?
If its 2 layer i could faffbending out one myself i suppose.
« Last Edit: August 03, 2018, 01:22:19 am by MT »
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: PIC32MX vs STM32L4, my first impression
« Reply #13 on: August 03, 2018, 05:05:00 am »
I was surprised EVK is 2 layer and has 133Mhz SDRAM i assumed 4 layers would be needed. I need to debug in ongoing development board. JLINK base seams to support MCUXpresso but expensive, do EVK have break out for SW interface?
If its 2 layer i could faffbending out one myself i suppose.

The chinese Jlink V9 is very cheap and works well with MCUXpresso and Jflash, it is the best and cheapest option. if you want an original Jlink but you do not want to spend a lot of money you can buy the EDU version

The evaluation board can be connected to Jlink and Multilink by JTAG with a flat cable 2x10 pin IDC connector.

According to the scheme, there are four jumpers with access to SWD and UART, I suppose that if you remove them you can connect directly with some SWD programmer / debugger without using OpenSDA, but I think it is better to use Jlink (Chinese version) by JTAG.

I want to make my own board, but for now I prefer to try everything with the evaluation board, so I can use the programming and the Debug from MCUXpresso. The evaluation board has Arduino type connectors, to connect your own boards (shields). I have already designed this board from the second picture attached to try one of my products, that I am migrating from Kinetis. The first picture is the Arduino type expansion connectors, from the evaluation board.







« Last Edit: August 03, 2018, 05:14:03 am by luiHS »
 

Offline KarelTopic starter

  • Super Contributor
  • ***
  • Posts: 2217
  • Country: 00
Re: PIC32MX vs STM32L4, my first impression
« Reply #14 on: August 03, 2018, 06:17:52 am »
Apart from the supposed lower power consumption of the STM32L4 (compared to the PIC32MX),
are there any other advantages? Because so far I don't see them.
 

Offline awallin

  • Frequent Contributor
  • **
  • Posts: 694
Re: PIC32MX vs STM32L4, my first impression
« Reply #15 on: August 03, 2018, 06:30:27 am »
Apart from the supposed lower power consumption of the STM32L4 (compared to the PIC32MX),
are there any other advantages? Because so far I don't see them.

I'd be interested in how hard/easy it is to set up the IDE and programming/flashing for STM32 (e.g. nucleo-boards, or olimex).
We've done some boxes with Arduino Due controllers + ethernet shield, but a Nucleo-board with on-board Ethernet seems nicer - if the IDE and programming experience and availability of libraries is anything similar to arduino??
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: PIC32MX vs STM32L4, my first impression
« Reply #16 on: August 03, 2018, 08:05:17 am »
Apart from the supposed lower power consumption of the STM32L4 (compared to the PIC32MX),
are there any other advantages? Because so far I don't see them.


that's why why i keep getting back to PICs.
 

Offline MT

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: aq
Re: PIC32MX vs STM32L4, my first impression
« Reply #17 on: August 03, 2018, 12:58:48 pm »
I was surprised EVK is 2 layer and has 133Mhz SDRAM i assumed 4 layers would be needed. I need to debug in ongoing development board. JLINK base seams to support MCUXpresso but expensive, do EVK have break out for SW interface?
If its 2 layer i could faffbending out one myself i suppose.

The chinese Jlink V9 is very cheap and works well with MCUXpresso and Jflash, it is the best and cheapest option. if you want an original Jlink but you do not want to spend a lot of money you can buy the EDU version

The evaluation board can be connected to Jlink and Multilink by JTAG with a flat cable 2x10 pin IDC connector.

According to the scheme, there are four jumpers with access to SWD and UART, I suppose that if you remove them you can connect directly with some SWD programmer / debugger without using OpenSDA, but I think it is better to use Jlink (Chinese version) by JTAG.

I want to make my own board, but for now I prefer to try everything with the evaluation board, so I can use the programming and the Debug from MCUXpresso. The evaluation board has Arduino type connectors, to connect your own boards (shields). I have already designed this board from the second picture attached to try one of my products, that I am migrating from Kinetis. The first picture is the Arduino type expansion connectors, from the evaluation board.

Thanks for info luiHS! Unfortunately i cant use full JTAG only 3 wire SWO.I intend to try swap out a F446/429 for RT1020 in a existing design. But good news EVK have SWO breakouts. I dont like Aurdion plugins just faffs up signal integrity.
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: PIC32MX vs STM32L4, my first impression
« Reply #18 on: August 03, 2018, 07:41:54 pm »
Thanks for info luiHS! Unfortunately i cant use full JTAG only 3 wire SWO.I intend to try swap out a F446/429 for RT1020 in a existing design. But good news EVK have SWO breakouts. I dont like Aurdion plugins just faffs up signal integrity.

I have all the components to design and assemble my own board for some time, with an RT1020 LQFP100 that I bought from Digikey (10 pcs), and then some more to Mouser.

What I still do not have very sure is if I can install QSPI and SD with this micro LQFP100. Unlike the LQFP144 that installs the evaluation board, the LQFP100 has a single SD port and one of its pins is shared with another signal that the QSPI needs, although there seems to be an alternative Flexspio port to connect the QSPI.

For now, for convenience, I'm going to try the evaluation board and the shield that I designed, today I just received the PCB, I assemble it and start testing. The first thing I want to see is how the DMA is configured, for me the most important thing.











 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: PIC32MX vs STM32L4, my first impression
« Reply #19 on: August 03, 2018, 07:54:09 pm »
Apart from the supposed lower power consumption of the STM32L4 (compared to the PIC32MX),
are there any other advantages? Because so far I don't see them.

I'd be interested in how hard/easy it is to set up the IDE and programming/flashing for STM32 (e.g. nucleo-boards, or olimex).
We've done some boxes with Arduino Due controllers + ethernet shield, but a Nucleo-board with on-board Ethernet seems nicer - if the IDE and programming experience and availability of libraries is anything similar to arduino??

It is relatively simple using Cubemx, which is the wizard to configure the entire periphery with the STM32. This utility is integrated into the ST IDE SW4STM32 (based on Eclipse).

The only thing I miss in the ST development environment is that they do not have a menu option with source code examples for the most common model programs. That's what you have in Arduino, and it's also offered by NXP with MCUXpresso for its microcontrollers (LPC, Kinetis, i.MX).

Now I'm just starting with the RT1020 from NXP, using MCUXpresso, and once the corresponding SDK is imported, there are lots of source code examples for any peripheral (SPI, IC2, UART, DMA, WIFI, Bluetooth, GPIO, etc...) and generic sources for start with simple things like the typical Hello world using the serial port, flashing LEDs, etc ...You can create your own project by importing any of the many examples of source code, from the IDE itself. Then it can be modified and configured using the Config Tools, which is the IDE MCUXpresso assistant, something similar to the Cubemx of the STM32.

Some time ago I tried the Atmel SAM S70, and with Atmel Studio they also have an option to access examples of source codes, although it is not as good as what NXP offers with MCUXpresso.
« Last Edit: August 03, 2018, 07:58:42 pm by luiHS »
 

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: ca
Re: PIC32MX vs STM32L4, my first impression
« Reply #20 on: August 03, 2018, 08:28:06 pm »
This thread has mutated to PIC32MX vs STM32L4 vs nxp RT1020, which is good, because I have just started looking at the RT1020!. One thing I have noticed, compared to STM32F4  the RT1020 doesn't seem to have any 5V tolerant GPIO, is that the case? Not hard to design in level shifters, but stm32 is very convenient that way.

  Also I have been looking at various SDRAM, does nxp recommend any specific parts?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: PIC32MX vs STM32L4, my first impression
« Reply #21 on: August 03, 2018, 09:39:02 pm »
I'd also look at the 'slower' NXP LPC series like the 1700 and 1800 series. AFAIK some of these also have SDRAM interfaces. These all have internal flash as well and most have 5V tolerant I/O. I think the 1100, 1200, 1300, 1500, 1700 and 1800 series are more competitive to ST's STM32 range.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline chickenHeadKnob

  • Super Contributor
  • ***
  • Posts: 1055
  • Country: ca
Re: PIC32MX vs STM32L4, my first impression
« Reply #22 on: August 03, 2018, 11:12:01 pm »
I'd also look at the 'slower' NXP LPC series like the 1700 and 1800 series. AFAIK some of these also have SDRAM interfaces. These all have internal flash as well and most have 5V tolerant I/O. I think the 1100, 1200, 1300, 1500, 1700 and 1800 series are more competitive to ST's STM32 range.
Thanks, those older lpc are something of a step sideways from stm32, at this point I would need a more compelling inducement, like the cost/performance ratio of the RT1020 to make me switch from the tool chain and parts I already know. The 5V issue isn't a big deal with me, just a nice to have.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 221
  • Country: au
Re: PIC32MX vs STM32L4, my first impression
« Reply #23 on: August 04, 2018, 12:33:08 am »
You could take a look at the newer STM32 F730/F750/H750 series chips.
They have minimal on chip flash for bootloader/booting to QSPI flash, and as such are quite cheap ($5 for single chips from Digikey for the easily solder-able F730R8 LQFP64 part).

However if you are specifically looking for low power etc, the F7 series isn't as good as the L4's (I have no experience with PIC's). The H7 is a little bit better as they are built on a newer process and have more power domains so you can more dynamically turn on and off different parts of the chip.
 

Offline aandrew

  • Frequent Contributor
  • **
  • Posts: 277
  • Country: ca
Re: PIC32MX vs STM32L4, my first impression
« Reply #24 on: August 04, 2018, 01:40:58 am »
that's why why i keep getting back to PICs.

It's funny how things work out -- I started out on PICs and charge a premium to have to work with them these days. Shit IDE, proprietary compilers, terrible debugger environment... ugh. Gimme some STM32 any day. Open tools, good peripherals, excellent documentation, great support, and my ARM chops are easily transferable to any number of other vendors, although I very much prefer and recommend STM32 over NXP. I've also played a bit with the off-brand ARMs such as GigaDevice and Nuvoton, but their peripherals and documentation are very poor comparatively speaking.

I'd love to hear why you prefer PICs, Chacon son gout and all that stuff notwithstanding...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf