EMW3165 – a ESP8266 WiFi killer?

ahull
Mon Jul 13, 2015 11:42 am
:!: Hackaday readers will no doubt already have read this.. http://hackaday.com/2015/07/13/new-part … 66-killer/

Given the price and performance… I want one :D

It wont be long before the China board houses have these on tap. There is already a dev board for this dev board on fleabay.


mrburnette
Mon Jul 13, 2015 12:14 pm
ahull wrote:<…>
I want one :D

martinayotte
Mon Jul 13, 2015 12:41 pm
Like one of the Hackaday commenter said :

Everyone should keep in mind that seeedstudio sells the ESP for $6.95 to $7.50. So if/when the Chinese sellers on ali/ebay pick it up it will become cheaper.

So, I’m just waiting those things appearing on Ali/eBay soon, I will then purchase some. ;)


madias
Mon Jul 13, 2015 1:53 pm
All I see is an under 8USD STM32F411CE dev board with some wifi gadget;)

RogerClark
Mon Jul 13, 2015 11:04 pm
Are there any details of how you develop for this board?

It looks like a cheap Spark aka Particle Photon board.

I have 2 Photon boards ( which cost a fortune… my mistake buying them), but development is only Sparks stupid online system.

So until someone releases the Libs and API etc for this, its going to be hard to develop for.

Im not saying i wont buy one or two, but suspect they will sit on the shelf for quite some time.

Edit.

Just one thought about the cost.

I’m surprised its as cheap as it is. I’m not sure what bulk pricing is on the F411 but I can’t see how a F411 + wifi hardware is ever going to price comparable with the ESP8266.

But I guess its different markets, e.g. they mention wifi cameras


martinayotte
Tue Jul 14, 2015 2:10 am
RogerClark wrote:I have 2 Photon boards ( which cost a fortune… my mistake buying them), but development is only Sparks stupid online system.

mrburnette
Tue Jul 14, 2015 2:50 am
martinayotte wrote:RogerClark wrote:
<…>
Yes, although people complains of high cost compare to ESP8266 modules, we need to consider that it is an F4 with lot of Flash and SRAM. Those F4 chips cost more in low quantity than the EMW3165 module itself.

victor_pv
Tue Jul 14, 2015 3:21 am
mrburnette wrote:martinayotte wrote:RogerClark wrote:
<…>
Yes, although people complains of high cost compare to ESP8266 modules, we need to consider that it is an F4 with lot of Flash and SRAM. Those F4 chips cost more in low quantity than the EMW3165 module itself.

RogerClark
Tue Jul 14, 2015 10:58 pm
BTW.

Particle claim they have now sold 10,000 Photon boards, and are now in partnership with Microsoft and who have added support for Photon to Azure (I’ve not looked to see what they’ve added to Azure as if its anything like the rest of Azure I will be avoiding it with a bargepole)

This mew board is far more of a threat to the Photon than it is to the ESP8266

I did try to find some docs on the EMW3165, but I couldnt find much.

It looks like the F411 communicates with the wifi sub module via SDIO.

The same company appears to have produced a pervious version which communicated to the wifi sub module via serial (well I found a doc about this while trying to find the docs on the EMW3165, as the doc had the same file name as the technical doc for the EW3165)

If anyone has links to the main tech doc, it would be good to post it here, to save people time looking elsewhere.

I guess i should order some of these today, as i have a home project that i need a ESP8266 and an STM32 for solar power monitoring, which would suit this new device.


RogerClark
Wed Jul 15, 2015 12:51 am
Ok

I’ve back – ordered some of these from SeedStudio. Its a bit hard to determine whether they have any, or when they will ship.

They have it listed as “Back order” but the shipment date is listed as 15th July (i.e today) so something’s not quite right there

The only docs I can find at the moment are

http://www.mxchip.com/d/file/2015-03-17 … 369e51.pdf

So I’ve posted to SeedStudios forum and I will email SeedStudio as well to see if I can get more info.

Edit.
I’ve sent messages to SeedStudio and MXChip via their contact form systems.

I will update the forum when and if I get a response form either company

PS. If this gets more popular I suspect it will need its own section rather than just a single thread in Off Topic


martinayotte
Wed Jul 15, 2015 2:00 am
Thanks you, Roger, for taking a plunge with this module !
I wish to do the same soon ! ;)
Even if pricing is higher than ESPs, it is far from those of TI’s bullsh*t CC3x00 … :x

RogerClark
Wed Jul 15, 2015 2:17 am
Martin,

No worries.

Its tax deductible for me ;-) Not that it really makes it that much cheaper.

I have some clients who are interested in IoT and I have already built one very basic prototype for an IoT battery monitor using the ESP8266.

However its early days in this sector for me, as the bulk of my work is Apps and Web.

But, I’ve had several, out of the blue, enquiries about developing for IoT, but they’ve wanted development using the Broadcom chipset, which I have no knowledge of, and from what I understand its a fairly closed platform (and its expensive to develop and to deploy).

There also appears to be interest in BLE (mainly iBeacons), which is one of the reasons I have just ordered some of those Nordic NRF BLE chips as used on the new BBC Micro BIt device. I don’t think the Micro Bit is any good, but I think the Nordic chips are probably better to develop with than the TI CC2541 devices, which need a very expensive proprietay compiler to use them (because the CC2541 use an 8051 as their MPU and there isnt a viable GCC for that device as far as I’m aware, and also TI don’t have binary libs for the BLE stack for GCC)


martinayotte
Wed Jul 15, 2015 2:37 am
RogerClark wrote:
I have some clients who are interested in IoT and I have already built one very basic prototype for an IoT battery monitor using the ESP8266.

However its early days in this sector for me, as the bulk of my work is Apps and Web.

But, I’ve had several, out of the blue, enquiries about developing for IoT, but they’ve wanted development using the Broadcom chipset, which I have no knowledge of, and from what I understand its a fairly closed platform (and its expensive to develop and to deploy).

There also appears to be interest in BLE (mainly iBeacons), which is one of the reasons I have just ordered some of those Nordic NRF BLE chips as used on the new BBC Micro BIt device. I don’t think the Micro Bit is any good, but I think the Nordic chips are probably better to develop with than the TI CC2541 devices, which need a very expensive proprietay compiler to use them (because the CC2541 use an 8051 as their MPU and there isnt a viable GCC for that device as far as I’m aware, and also TI don’t have binary libs for the BLE stack for GCC)


RogerClark
Fri Jul 17, 2015 10:51 am
Just a quick follow-up

Currently there appears to be absolutely no documentation or code libraries for this new board.

At the moment, my order is still listed as “processing” which I presume SeeedStudio don’t actually have any of these.

I did try contacting them, via their forum and also via their contact form, to request more information, but so far that has drawn a blank.

I also tried to contact MXChip via their contact form, and again, no reply.

So… At the moment these devices are looking like vaporware :-(


RogerClark
Sat Jul 25, 2015 12:33 am
Update.

SeedStudio’s site is now linking to this github repo

https://github.com/MXCHIP/MICO

Which also has a link back to this

http://www.mxchip.com/mico/begin/micoapis/

The “project” files are for IAR workbench, but I don’t know if there are any IAR static libraries that it links, or whether they just happen to use IAR.

I’ve posted an issue to find out if they use any static IAR libs, or whether it could be compiled under GCC instead of IAR


Erni
Sat Jul 25, 2015 1:17 pm
There is a forum for the emw3165

http://www.emw3165.com/index.php

Not much info yet, but there are links to github for emw3162


RogerClark
Sat Jul 25, 2015 9:37 pm
Thanks for the link

I wonder who runs the site, it looks a lot like ESP8266.com


RogerClark
Wed Aug 05, 2015 12:16 am
Update.

My EMW3165 boards arrived this morning. They are smaller than I’d anticipated.

Size of the module is 32mm x 16mm.

The spacing on the pads is incredibly small. Smaller than my EPS8266 ESP-12.

At the moment I’m not entirely sure how I can connect to the board.
I may be able to solder some very fine wires to a few of the pins, but ultimately I’m going to need a breakout board.

SeeedStudio do a massive breakout board for $21, but its huge, and has loads of other stuff on it like a battery box etc

There is also a simple one on Dirty Cheap PCBs, which is probably a better bet, however soldering the module to the breakout will be tricky in its own right.

ummm, As I have another project on the go that needs my attention, I think it may be a while before I can make any sense of these boards


martinayotte
Wed Aug 05, 2015 2:16 am
@Roger, I’m glad to see that you’ve received your new baby … ;)
I’ve pushed one in shopping-cart, but I was reluctant to checkout too early.
I will wait that Keil vs gcc/open-source issue is cleared out ….
(I saw today that there is a workaround by using Broadcom WICED libs in mean time, but …)

RogerClark
Wed Aug 05, 2015 2:45 am
Hi Martin

There seems to be a github repo with some code in it, but I think it uses Keil projects. The good sign however, as that I didn’t notice and recompiled library files, so I’m hoping that the interface files to the Wifi module are Open Source, (unlike some of the Bluetooth stacks e.g. TI which are proprietary and require you to use whatever compiler the manufacturer used to compile the libs)
However I’m sure the code probably uses either STM’s HAL or the STD peripheral lib, so I’ll need to use @sheepdoll’s port to the HAL rather than the main F4 repo.

Anyway. I’ve just ordered some breakout boards from Dirty PCB’s, but they are not on express postage, so I know they will not be here for quite some time.

Just soldering them to the breakout boards is probably going to be a bit challenging. I’ve been cheap and not ordered the solder template, for the breakout board, as that was another $25 (USD).

Hopefully the solder resist on the PCB will be good enough.


RogerClark
Wed Aug 05, 2015 6:48 am
Well,

I spoke too soon.

There are .a files in the github repo, which will be IAR workbench libraries :-( :-(

So unless MXChip build GCC objects, its not going to be much use without IAR, unless somehow GCC can link IAR objects


martinayotte
Wed Aug 05, 2015 12:58 pm
As I said, in the meantime GCC libs becomes available, I found those threads about using GCCWICED libs.
http://www.emw3165.com/viewtopic.php?t=11
https://hackaday.io/project/4128-emw3162

RogerClark
Wed Aug 05, 2015 9:39 pm
Hi Martin,

I had noticed the threads about GCCWICED, but I think that until i can power up the hardware and communicate via STLink, I will leave it to the guys on the EMW3165 forum to took at those libs.

Also, if i read it correctly, the libs are non distributable,… or perhaps that was some other broadcomm libs.


RogerClark
Mon Aug 10, 2015 11:37 am
I’ve soldered some very small wire onto the SMD pads on the EMW3165, and have hooked it up to my STLink and the device reads back as

21:25:53 : Device ID:0x431
21:25:53 : Device flash Size : 512KBytes
21:25:53 : Device family :STM32F411xE


martinayotte
Mon Aug 10, 2015 1:25 pm
Hi Roger,

Make sure to keep backup of the original firmware for further investigation.

I don’t have any F411, but I don’t think there are so much differences with F405. So, it should be easy to add variant in STM32F4.

Is the pads spacing 0.05″ or 2mm ?

I think I will jump in soon by ordering one module. Pricing is so attractive.


mrburnette
Mon Aug 10, 2015 8:56 pm
martinayotte wrote:
<…>
I think I will jump in soon by ordering one module. Pricing is so attractive.

RogerClark
Mon Aug 10, 2015 9:35 pm
Martin,

Pads are at 1mm spacing, and are 0.7mm wide. i.e only 0.3mm between pads.

This makes it generally had to solder, as its very easy to accidentally bridge between adjacent pins.

I have ordered some breakout boards from Dirty PCBs, but they will not be that easy to solder either. I have a reflow air gun thingy, but I don’t have a reflow oven.
Well, i bought a toaster oven to do reflow ( a few years ago), but have never got around to converting it to a reflow oven, as generally I don’t have a need for it, as usually build stuff with 0.1 inch modules and through board components.

Re: Unit pricing

The price is very good if you consider its a fully functional STM32F411 and high quality Broadcom wifi.

But, unless you have need for that level of performance, and a lot of GPIO, its far more cost effective to use an ESP8266.

And at the moment MXChip are not really doing much in terms of providing online support for this device, to the Maker community.

I think one person on the Ewm3165 forum, rang MXChip and they claim to be working on a Gcc compatible version of the source code, but it still has not appeared.

I emailed both MXChip and SeeedStudio requesting more information, but didn’t get a reply from either.

I presume MXChip are not interested in the OpenSource / Maker community, and are probably just focussed on industrial users, who may buy these in much larger volumes than a few hundred of hobbiests.

Re:Backing up of the exiting firmware.

Its the first thing I did.

I have several modules, so if i have stuffed up the backup, i can download it from another module.

But as far as I can tell, its only got around 6k of program in its flash. Which is smaller than our bootloader, so it cant be doing very much.

There are mo discernible english text strings in the firmware.

Martin, I can email the firmware bin to you if you want to look at it, but i doubt its worth bothering with, unless you have a lot of free time to kill ;-)


RogerClark
Mon Aug 10, 2015 11:56 pm
Martin,

Not that this is of much use. But reading the docs on the device, it looks like its preloaded with firmware that provides similar features to the AT command set on the EPS8266 etc.
Except I don’t think its AT based, it looks like their own protocol, which just happens to be sent via serial.

I think somehow there is also a transparent Serial over TCPIP functionality on port 8080, however I’m not sure how you configure it, i.e how each device knows the remote IP address

There is documentation in this manual.

http://www.mxchip.com/download/Wi-Fi%20 … 001%29.pdf

Anyway, I can’t have backed up all the firmware if all these features are within the F4. However I suspect that perhaps the Broadcomm wifi SoC is doing all the heavy lifting in this case, and perhaps the F4 is just acting as a Serial to SPI bridge (or Serial to SD bridge) to communicate with the Boardcomm device.

BTW. I did manage to login to the wifi side of the device, as the doc indicates the username and password are both “admin”. There is a feature in there to upload firmware. But again, I suspect this is not firmware to the F4, I suspect its firmware to the Broadcomm side of things

Also. As my breakout boards won’t be here for several weeks (they are on the slow boat from China), I’m making a breakout by hand using some Vero board. But I’m not going to wire all 40 pins as that would take ages.
I’m just going to do a few basic connections e.g. a few GPIO’s, Hardware serial 1 – which I think is PA10 and PA6 (I’ll need to double check as this is different from on the F1). As well as the STLink / SWD stuff. I may also see what the minimum is required to connect USB. I think its just 2 x 22ohm resistors, the 1.5 k pullup, and some small capacitors, but I’ll need to see if I can find a very simple circuit for usb on a F4, because upload via DFU on USB is built into the hardware isnt it ?

And… I’ll have another go at down reading the firmware image, as the flash doesn’t appear to be locked.


martinayotte
Tue Aug 11, 2015 3:08 am
Hi Roger !

Thanks for all those info ! i think I will have to digest them before answering in more details … ;)

For now, maybe let’s clearing out the pin spacing : are you sure that it is 1mm spacing (1.27mm = 0.05″ would be more a standard)
If it is really 1mm, it will be more difficult to find male-female headers.

For price attractiveness, when I wished a year ago to stuff my STAMP32 board with F405, it cost me CAN$12 for the CPU, plus CAN$2 for the crystal, so having a board with F411 for CAN$10.00 (exchange rate here) is really attractive.

I will dig all info your provided more thoroughly tomorrow since I’m falling to sleep …


RogerClark
Tue Aug 11, 2015 7:29 am
Hi Martin,

This appaears to be the mechanical / electrical / general spec for the module

http://www.mxchip.com/d/file/2015-03-17 … 369e51.pdf

In section 6.2 “Recommended footprint” ( (page 21), it seems to indicate that the centre to centre distance on the pads is 1mm. and it shows pad width of 0.7mm
I’ve measured the overall dimension of 20 pads down one side of the module and it is 20mm, so I’m fairly sure the dims in that doc are correct.


RogerClark
Tue Aug 11, 2015 8:51 am
I just took another look at the contents of the flash, and the STlink was being a bit too clever and has decided that as there were a load of memory locations with 0xff in them, that it must be the end of the program in flash

However when I manually changed the amount of flash to read, to 0x200000, ile all the flash, I can see that there is some code at 0x800000 for about 6k, then a gap up to 0x800C000 i.e 48k,
Then there is around 300k of data. This seems like a lot of data for just code, so I suspect it also contains images that the wifi admin system uses.

Taking a quick look at the bin file, the HTML for the admin system seems to be in the F4’s flash rather than in the wifi sub system

e.g. there is text like this

<HTML>
<HEAD>
<TITLE>Error</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
</HEAD>
<BODY><H1>401 Unauthorized.</H1></BODY>
</HTML>


martinayotte
Tue Aug 11, 2015 6:05 pm
mrburnette wrote:martinayotte wrote:
<…>
I think I will jump in soon by ordering one module. Pricing is so attractive.

martinayotte
Tue Aug 11, 2015 6:35 pm
Hi Roger,

So much informations you’ve provided, thanks, I decided to jump into : I’ve just placed my order ! (but, normal postage shipping to save the cost)

I can email the firmware bin to you if you want to look at it
I don’t need it for now, I do my own backup when I get my module … ;)


I may also see what the minimum is required to connect USB. I think its just 2 x 22ohm resistors, the 1.5 k pullup, and some small capacitors, but I’ll need to see if I can find a very simple circuit for usb on a F4, because upload via DFU on USB is built into the hardware isnt it ?

Yes, inspires yourself with the stm32f4stamp schematic from Frank Zhao (see attachment), he didn’t even bother with the 1K5, but I suggest to add it.

Then there is around 300k of data


RogerClark
Tue Aug 11, 2015 9:12 pm
Hi Martin

Thanks for the information.

I think I will need to wire up my spare EMW3165, as the first one has given up on running its wifi. I think the F4 is OK, as STLink talks to it and i can read the flash and even look at the cpu registers etc.

Actually, I will try running it off an external usb psu first, as the voltages i get from my PC are well below 5v, so I suppose that may be the problem.
I will also unsolder the wires I attached to the USB and one of the SPI pins, on the offchance i have shorted something.

I did take a quick look at making another variant last night, and reacquaint myself with the F4 folder, and i was surprised that there is only one Variant folder.
I will need to look at the code in the folder, as the F405 stuff must be very similar to the 407 for it to be able to share the same code.

I’m not at all familiar with the F4 family, and how the F411 differs from the 407. I know the clock is only 100mhz, instead of the 168mhz on the 407, but I will need to see where the PLL stuff etc is setup, to see if anything needs to be changed for 411.


martinayotte
Tue Aug 11, 2015 10:11 pm
RogerClark wrote:
I did take a quick look at making another variant last night, and reacquaint myself with the F4 folder, and i was surprised that there is only one Variant folder.
I will need to look at the code in the folder, as the F405 stuff must be very similar to the 407 for it to be able to share the same code.

RogerClark
Tue Aug 11, 2015 10:21 pm
Hi Martin

There is loads of stuff in the F1 as well, where the naming could be drastically improved, but as its working and most people don’t care about the internals, its seems pointless wasting time changing it.

I just powered my module off a USB supply, but its still not appearing as Wifi any more :-(

I’m just downloading a wifi scanner, to see if its broadcasting at all, e.g. in some sort of unitialised mode.

But it looks like I’ll need to wire up my spare on as well.


RogerClark
Wed Aug 12, 2015 9:41 am
I’ve wired up my spare EMW3165, and its Wifi is working, but the original one I was using, no longer has wifi :-(

I can still use STLink to read the firmware in the original module, but no matter what I do the wifi is not visible at all.

I can only think of a few reasons why the original module is no longer working correctly.

Firstly I used a hot glue gun to glue module onto my home made breakout board, and I then used a hot air gun (solder reflow gun) set to 100 deg to melt the glue a bit, so I could reposition the module. I looked at the reflow soldering temperature characteristics curve, and the whole module can’t be heated at more than 3 deg per second. However I was not heating the whole board, just blowing 100 deg C air under it from a distance.
So although this is one possible cause, it would mean that these modules are very liable to failure when if put in a reflow oven to solder them to a PCB.

The other possibility is that I somehow shorted out an adjacent contact, that had some impact on the boards comms with the Wifi module.
However I strongly suspect that whatever the connections are to the Broadcom wifi module, that they are not on pins that are broken out to the edge of the module.

Perhaps somehow I managed to accidently do something using STLink which has change some sort of battery backed or EEPROM setting, but this also seems unlikely

Or perhaps its some sort of electrical static damage to the wifi via its antenna – which is on a pin on the breakout.

Who knows.

All I know is I now have one board that no longer functions on Wifi :-(


Erni
Wed Aug 12, 2015 11:42 am
I got my emw3165 in the mail today, and managed to solder on some thin wire to the gnd and VDD pads (pew that realy put some strain on my old eyes, they are very small).

When I connected it to a 3.3V supply it turned up as MX-Chip_50A781 in the available wifi list. I used admin, admin (thanks RogerClarke) to login.
There are all kinds of information available from the module, which I only partly understand, but one page shows that it is possible to upload new firmware see below:


jmg5150
Wed Aug 12, 2015 8:24 pm
Hi Roger + all,

Just thought I’d chime in on this topic – thanks to emilfr, there’s now a patch for the WICED SDK which can be used to compile code for this module using GCC. http://www.emw3165.com/viewtopic.php?f=10&t=11
github repo here: https://github.com/MXCHIP-EMW/WICED-for-EMW

I also checked back in with MXCHIP yesterday and their estimate for GCC porting to be completed is still another 3 to 4 weeks.

The guys behind the WiFiMCU project (http://www.wifimcu.com/en.html) seem to have made an awesome breakout board for this module however I cannot find anywhere to purchase it, and my emails to them have gone unanswered. I’m thinking to bite the bullet and whip up my own in the coming days.

I’d love to see this project working on the EMW3165, let me know if there’s anything in particular I can do to help.

Cheers,
-Jonathan


RogerClark
Wed Aug 12, 2015 9:15 pm
I have soldered Vcc,Gnd and 2 wires for Stlink.

I use a pair of cheap x3 magnifying reading glasses, but really i need something with more magnification. I think Vassilis linked to a pair of x10 binocular magnifiers on AliExpress, I should really buy some of those ;-)

I also saw all those settings, and that you can upload firmware, ( also see Martins post).

Be very careful if you only have one module. I have somehow broken the wifi in one of my modules.

I have not had time to try compiling and uploading via STLink yet.


RogerClark
Thu Aug 13, 2015 3:12 am
I just did 2 videos on first impressions on the EMW3165. (apologies about the audio level )

https://www.youtube.com/watch?v=Ow3AqO7-udE

https://www.youtube.com/watch?v=NpX2iIsmAes


martinayotte
Thu Aug 13, 2015 3:37 am
Thanks for the videos !

During your video, there is mentioned about additionnal 2M SPI Flash, that means there is maybe data there too, maybe SPIFFS too.
We will need to figure out that, because it is not memory mapped directly, so not been seen by STLink …


RogerClark
Thu Aug 13, 2015 4:11 am
Martin,

Yes. The spec mentions 2M external SPI flash.

I’m not sure what device they use for the flash. It may be possible to work it out from their guthub repo. I suspect its currently empty, or just contains some settings.

The existing firmware seemed to remember that my PC had logged in before, even if I cleared my browser cache, so perhaps its doing some Mac ID comparison and storing it in the external SPI flash, or possibly in a block of the internal flash.
I’ve not trawled through the flash looking for something that looks like a mac addreess yet.

As I seem to have killed the wifi on one of my modules, I have no qualms about uploading some arduino code, at least to blinking an LED, as the device is half dead already !

But the EPS8266 stuff with SPIFFS etc is a bit urgent, even though neither is work related (at least not directly)


mrburnette
Thu Aug 13, 2015 1:15 pm
RogerClark wrote:
<…>
I use a pair of cheap x3 magnifying reading glasses, but really i need something with more magnification. I think Vassilis linked to a pair of x10 binocular magnifiers on AliExpress, I should really buy some of those ;-)
<…>

martinayotte
Thu Aug 13, 2015 2:05 pm
RogerClark wrote:
As I seem to have killed the wifi on one of my modules, I have no qualms about uploading some arduino code, at least to blinking an LED, as the device is half dead already !

RogerClark
Thu Aug 13, 2015 9:15 pm
Hi Martin,

Thanks for the tips on SPIFFS, its not super urgent. But its something that i do need to sort out.

Re: F411

I found this article on clock settings for various F4 devices

http://stm32f4-discovery.com/2015/01/pr … x-devices/

I will take a look over the weekend at making a F411 variant. Lookng at the F1 code, I noticed that the PLL multiplier stuff seems to have been moved to #defines in the variant board file.
So I expect I will need to do something similar on the F4


martinayotte
Fri Aug 14, 2015 2:13 am
I think this link will help to tweak PLL code more easily …

RogerClark
Fri Aug 14, 2015 7:47 am
Martin,

Did you post a link ??

I have taken a look at the code and there is a substantial difference between the way the F1 core sets up the board to the F4 core.

It looks like Leaflabs must have done some fairly major refactoring after the AeroQuad guys took their copy.

In the F1 each variant has a file called boards_setup.cpp in the wirish folder, defines a load of __weak functions, which are called from boards.cpp in the core.

But the F4 doesn’t have boards_setup.cpp in the variant.

As I think in the longer term we will probably end up going to a HAL / Standard peripheral library core (e.g. based on @Sheepdoll’s work), I don’t think its worth refactoring the F4 stuff just for the PLL stuff (if thats the only real change to the core)

We’d be better off just having an Ifdef inside

static void setupClocks() {
rcc_clk_init(RCC_CLKSRC_PLL, RCC_PLLSRC_HSE, RCC_PLLMUL_9);
rcc_set_prescaler(RCC_PRESCALER_AHB, RCC_AHB_SYSCLK_DIV_1);
rcc_set_prescaler(RCC_PRESCALER_APB1, RCC_APB1_HCLK_DIV_2);
rcc_set_prescaler(RCC_PRESCALER_APB2, RCC_APB2_HCLK_DIV_1);
}


RogerClark
Fri Aug 14, 2015 8:15 am
Just a quick update

I’ve done a hack job and its working !

I have an LED blinking on PB10 ! and have managed to scale the delay stuff so its kind of at the correct speed !

Actually, I think we should seriously consider switching to @sheepDoll’s core, even though it doesnt have any libraries, as I suspect that integrayion to the Broadcom WICED stuff is going to possibly be easier via the SPL / HAL.

I’m going to make a new repo taking SheelDoll’s branch that is based on the CubeMX files and see if I can build a F411 variant

In the mean time I will push my changes after I”ve had something to eat ;-)

Edit.

I think I spoke too soon. My Blink sketch is working, but I realised that I’d not changed the RCC PLL values

So I try changing

rcc_clk_init(RCC_CLKSRC_PLL, RCC_PLLSRC_HSE, RCC_PLLMUL_9);

and it made no difference

in fact all the calls in the setupClocks() seem to have no effect.

I’ve tried power cycling the board, just to be sure that it was no some residual effect, and it still blinked after I plugged it back in after 30 seconds.

It could be that the defaults that the chip always uses, generally runs.

Looking at the definitions in rccF2.h they don’t seem to correspond to the F4 programming manual RM0009, but I think I must be barking up the wrong tree or something, as lots of things just don’t seem to match with whats in the manual ;-(

Edit.

It looks like some setupClocks() is actually redundant, as it looks like it generally gets overridden by functions like void SetupClock168MHz()

So I need to copy one of these, (probably void SetupClock120MHz()) and make a new function called void SetupClock110MHz() and setup the correct clock values in there, and make sure I put in some defines to get it compiled in place of the other setupclockxxx functions.

Last edit for today.

Well, good job I’m using the board where I’ve already broken the Wifi as messing around with the clocks has got it into a position where stlink don’t connect any more.

I’ll need to wire up the reset line and try to do a connect under reset and see if that works. (but thats a job for the weekend !)

I had to wire a line to reset and pull it low while the Arduino IDE tried to upload, then when I released reset it uploaded again

It looks like the default config of the PLL reg’s works OK, but not my new settings :-(

I will need to investigate what settings are needed, as using the settings from the blog that linked to, didn’t seem to work
Using the PLL_M, PLL_N and PLL_P settings from that link or from this file

https://github.com/MXCHIP/MICO/blob/d56 … tm32f4xx.c

But at least the default config for the PLL reg seems to work, albeit I suspect its a very low speed fallback.


martinayotte
Fri Aug 14, 2015 2:43 pm
RogerClark wrote:
Did you post a link ??

martinayotte
Fri Aug 14, 2015 2:49 pm
RogerClark wrote:
in fact all the calls in the setupClocks() seem to have no effect.
[…] It looks like some setupClocks() is actually redundant, as it looks like it generally gets overridden by functions like void SetupClock168MHz()

RogerClark
Fri Aug 14, 2015 8:48 pm
Hi Martin

Yes. I found the code with the various frequency functions.

I tried making a new function to setup the clock for the 100MHz needed for the 411, by copying one of the other functions and changing the values. But didnt work.

at the moment it only working because it looks like the F4 operates in some sort of default / fallback mode if nothing is configured, and judging by the blink speed its running at about perhaps about 32mhz or perhaps 48 at the most.


martinayotte
Sat Aug 15, 2015 3:20 am
Hi Roger,
I don’t have much time these days to help you out, especially that I won’t have my single module until few weeks, but keep going/fighting about this old code base. ;)

RogerClark
Sat Aug 15, 2015 4:56 am
Matrin

No worries.

I’m doing 10 other things at the same time as well.

I’m actively looking at @SheepDoll’s HALMX stuff as well as hacking the existing F4 core, and I’m just about to download the WICED SDK stuff from Broadcom (I had to register to get it, so Its not exactly open source :-( )

So I’ll let you know how I get on.


RogerClark
Sun Aug 16, 2015 9:46 pm
Guys.

FYI.

The most promising build to develop on the EMW looks like

https://github.com/MXCHIP-EMW/WICED-for-EMW

However, its looking increasingly likely, that rater then the EMW’s wifi stuff being an addition to the current F4 core ( or to @sheepdoll’s core), that an Arduino core for this would need to somehow be an extension to the full WICED build.

Until there is a working build of WICED for EMW, its probably fairly pointless messing around with an F4 core for this device, unless someone just wants to use it was a $8 F4 ( with limited IO connections)

As it runs at 100Mhz, its not substantially faster then the F103, unless you need a maths co-processor.

@ Sheepdoll is updating her HAL based core at the moment, so I will wait until she has finished.
But after that, I may have a go at making a generic F411 core.

However beyond that, I think we will have to mothball this concept until the other dev teams have a reliable build process for WICED on EMW, (preferably one that doesnt just run on linux)

Also one big issue in my opinion, is the license on the WICED code, which you have to register with Broadcom to download.

i.e This is never going to be very mainstream, if people are required to register with Broadcom, then download and patch files ( even if the download and patching is automated / scripted).
As on the whole, most Arduino users expect to just download e.g. from the Boards Manager, and not to need to register and agree terms etc.


mrburnette
Sun Aug 16, 2015 11:16 pm
As on the whole, most Arduino users expect to just download e.g. from the Boards Manager, and not to need to register and agree terms etc.

YES (with emphatic warcry)

Ray


Leave a Reply

Your email address will not be published. Required fields are marked *