Tag Archives: Arduino

ESP8266 Arduino `.text’ will not fit in region `iram1_0_seg’ Error

I’ve been writing some software for a Wifi based CAN data logger for the ESP8266 in the Arduino platform, and have been getting a bit of a strange error. It appeared to be related to using the std::string functions in my code – and although I have used this in other sketches without issue, I suddenly received the following error as soon as I simply declared a std::string variable:

c:/users/scott/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: C:\Users\Scott\AppData\Local\Temp\build525647f6f8500d071cfab5cccf314276.tmp/ESPCANLogger.ino.elf section `.text' will not fit in region `iram1_0_seg'

collect2.exe: error: ld returned 1 exit status

A bit of googling appears to show that this is something to do with where those std libraries are stored in the code memory of the ESP8266 (I don’t fully understand the details of the chip). The issue is described in this issue in the Arduino ESP8266 github issues log:

https://github.com/esp8266/Arduino/issues/2794

There is a fix shown in this pull request

https://github.com/esp8266/Arduino/pull/2804/files

I had a bit of trouble locating the file referred to, because the Arduino boards manager doesn’t appear to store the added boards in the Program Files location anymore, but these are now located in the AppData folder in your user profile (on Windows 8)

C:\Users\USERNAME\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\tools\sdk\ld\eagle.app.v6.common.ld

The line which appears to fix it all should be added around line 163:

*libstdc++.a:(.literal .text .literal.* .text.*)

So my file then looked like this:

*libsmartconfig.a:(.literal .text .literal.* .text.*)
*libstdc++.a:(.literal .text .literal.* .text.*)
*(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text .irom.text.*)

There is some more detailed explanation about memory inside the ESP8266 here: https://tech.scargill.net/esp8266-ram/

ESP8266 CAN Bus with MCP2515

I have just bought another ESP8266/NodeMCU development board cheapy from eBay (this one) with an ESP-12E chip on board. I’ve also bought an SPI-CAN bus interface with the common Microchip MCP2515 CAN controller to try and create a CAN-Wifi gateway.

The pinout for the ESP-12E NodeMCU board is apparently as below:
ESP-12E NodeMCU Pinout

Continue reading

ESP8266 Development/SDK Board

Warning: do not connect the DHT11 temperature sensor as indicated in the eBay pictures, it is the wrong way around and will fry your board!

Update: Board has arrived, more details and pinout here

It would seem that the ESP8266 is quickly becoming a pretty well supported WiFI microcontroller within the DIY/hacker community, and certainly presents itself as a pretty good alternative to an Arduino for projects requiring simple IO and WiFi. There’s even a project looking at using compiling the Arduino IDE and compatible code for the ESP8266!

Chinese ESP8266 Breakout board

Chinese ESP8266 Breakout board

I have one of the original versions of these units, but ave struggled to get anything sensible out of it, and so was looking on Ebay for some more items and came across this breakout/development board. For £9.99 I thought I’d give it a go, and ordered it a couple of weeks ago. Will give more details when it arrives. More details and pics after the break

Continue reading

Arduino ECU By Brenamanf

I was sent a link to this website by the author, who appears to have created an Arduino ECU for spark control. Although the details are a little sparse, It appears that he has developed a lot of the required hardware himself. It looks like the main controller is an Arduino Nano and utilises Manifold Absolute Pressure (MAP) and a knock sensor to determine the ignition timing on a Peugeot 205 Tu9 45Ch. It would appear that the ECU has been developed over a number of revisions and has been in operation for over a year.

http://brenamanf.wordpress.com/page/2/

Video Explanation

I’ve made a video of the whole system explaining all of the sensors, actuators and interfaces, and some of the more advanced indicating equipment that I’m using.

A more detailed explanation of the closed loop ignition timing control is given here: http://scottsnowden.co.uk/?p=341

Closed Loop Ignition Timing Control

I have been busy over the last few weeks with various things, but have now completed most of the practical work on my project and am now at the stage of writing up the report/dissertation. I have successfully managed to achieve closed loop ignition timing control by using the Stellaris Launchpad development board to directly interface with the optical encoder on the engine and the pressure sensor charge amplifier (this replaces the AVL IndiSet 620 in my system).

ECU in black on left, angle of peak pressure and optical encoder interface on right. Connected together via serial

Continue reading

Arduino Controlled Electronic Ignition

Success! I have started and run the engine on my own electronic ignition. The problem was in the end quite simple, it turns out that the missing tooth wheel on the crank was aligned differently to what I expected. I thought that the missing tooth occurred 240 degrees after TDC, but in fact it appears to be aligned almost exactly at TDC. This meant that my spark was happening around Bottom Dead Centre, which is no use at all!

Continue reading

Updates and Ignition problems

From my couple of brief tests, I’ve identified a few problems which are preventing the engine from starting up and running for more than a few seconds.

  • The ignition timing at very low speeds < 500 RPM is very erratic, and not at all on time.
  • Under heavy acceleration the ignition timing is erratic, for example when pull starting the engine
  • There are some occasional misfires
  • The ignition timing is generally not massively stable – sometimes varying as much as 10 degrees(!) Continue reading