Olek's blog

To content | To menu | To search

Friday, August 14 2015

How to generate MCS file from Vivado?

There is still one function missing from Vivado 2015.2 - namely, the UI-accessible MCS file generation for FLASH memories. For now you can enter the "write_cfgmem" command in the TCL shell and play with its arguments. This is however not very user friendly.

Fortunately, the process can be easily automated by yourself! You can use "Tools" => "Customize commands" => "Customize Commands..." to add own buttons triggering TCL scripts. Knowning the "write_cfgmem" command, the only problem is how to get the path to the currently used bit file? I propose to do the complete solution like this:

write_cfgmem -force -format MCS -size 128 -interface SPIx4 -loadbit "up 0x0 [glob [get_property DIRECTORY [current_project]]/[get_property NAME [current_project]].runs/impl_1/*.bit]" "[get_property DIRECTORY [current_project]]/spi_mem.mcs"

This method should work until someone have several implementation runs in one project. This particular command generates MCS FLASH file called "spi_mem" for 128 M QSPI memory.

Friday, July 18 2014

The ipmitool compiled for Windows (1.8.14)

I have compiled the current version (1.8.14) of ipmitool application for Windows. As it is almost impossible to find a Windows binary of that, I thought it may be worth sharing. Please find it in the archive: ipmitool for Windows 1.8.14. Inside you will find ipmitool.exe, ipmievd.exe and Cygwin libraries required to run these applications. The available interfaces are: lan, lanplus, serial-terminal, serial-basic.

Monday, November 11 2013

Example project for STM32F429I under CooCox

I have prepared a simple demo project for STM32F429I that compiles under CooCox. It is a stripped down version of demo project from ST. It isn't very nice but shall be enough to provide a quick start with the STM32F429I microcontroller.

What is included:

  • StdPeriph libraries
  • LCD handling functions
  • touch panel support
  • external SDRAM test
  • gyroscope test

What is not included:

  • FreeRTOS
  • USB support
  • Widgets drawing library
  • DSP library

Download link: STM32F429I demo project CooCox

See my previous post for 2 MB FLASH programming algorithm for CooCox.

Sunday, November 10 2013

STM32F429I FLASH driver for CooCox

I have recently bought STM32F429I-DISCO (or STM32F429I-DISCOVERY) board from ST. Unfortunately, as far as I know, it is not yet supported by any free IDE. I am trying to compile the project under CooCox (with moderate success, the test applications are working but the main payload with FreeRTOS is not). I was using ST-Link Utility for programming the FLASH memory so debugging was not possible. To enable debugging the application under CoIDE a dedicated FLASH programming code had to be prepared.

I have managed to adapt the sources of FLASH drver provided by CooCox for the STM32F429I microcontroller. I enclose the modified sources and binary driver. For quick and dirty installation, you can just copy the ELF file into the 'flash' subdirectory under your CoIDE / CoFlash application and point it in the project settings (last tab). I have verified my modifications by downloading the example application from ST to FLASH. Using the driver I am also able to download my compilation to the microcontroller and debug it. I cannot guarantee it is 100% correct but at least it works for me :-)

Thursday, March 28 2013

STM32F4-DISCOVERY problem with accelerometer

If you use the Table 5 from STM32F4-DISCOVERY board as a guideline how to access the on-board LIS302DL accelerometer - be aware that there is a small bug waiting for you. The CS_I2C/SPI pin is indicated on pin PE2 but in reality it is connected to PE3 (see schematics).

Thursday, March 21 2013

STM32F4 C++ project in CooCox

For some time I have been struggling with compilation of C++ code for the STM32F4-DISCOVERY development kit - finally, it works. Here are some tips on preparing your own C++ project in CoIDE (version 1.7.0):

  • Include from repository the following components: C Library, M4 CMSIS Core, CMSIS Boot, and whatever else your application needs
  • In linker settings add the stdc++ and supc++ libraries, but be careful to select the 'right' version. In my case the full path to those files was C:\Program Files (x86)\arm-none-eabi-gcc-4_6\arm-none-eabi\lib\armv7-m (notice the last directory on path)
  • Do not rename files from .c to .cpp using F2 - it will not rename them on disk. Instead remove the files from project, rename them manually and add again.
  • With current CooCox and arm-none-eabi-gcc-4_6 compiler you do not have to write a single line of code more (especially, do not need to rewrite the 'new' operator nor modify the linker script, you also do not need to modify the project file - .cpp sources will be properly recognized by default)

Selecting the wrong version of libraries results in rising an exception during allocation of memory using the 'new' operator. In case you receive the "undefined reference to 'assert_param'" error, add the 'USE_STDPERIPH_DRIVER' to the 'Defined Symbols' list in project configuration.

My example project with abstract class, virtual methods and memory allocation with 'new' operator is available here: STM32F4 C++ example.

Sunday, January 6 2013

Inkscape fails to start

Since some time I had some strange issues with the Inkscape (0.48.4) on my machine under Windows. It was dying during startup displaying the "Inkscape encountered an internal error and will close now" message. After reboot the Inkscape usually worked fine, but after starting some other applications it were returning to consequently displaying this error. For example it appeared if the GIMP application was open. To get better understanding of this issue I had run the Inkscape through the gdb. I have found that it crashes on arithmetic exception in "C:\windows\SysWOW64\WinTab32.dll" (called from gdk_display_list_devices in libgdk used by Inkscape's DeviceManager).

Solution: renamed the C:\windows\SysWOW64\WinTab32.dll file to something else...

Remarks: the operation can cause damage to your system, use the "fix" on your own risk

Conclusion: Probably by doing so I have lost some features, but it has fixed the best SVG editor out there :-)

Tuesday, January 1 2013

USB CDC class driver for LPC1343

The LPC1343 comes with code bundle from Keil. Among the examples one can find the virtual serial port example, using the USB CDC class. Unfortunately the original .inf file works only for 32-bit systems. To solve the problem, I have grabbed the template file for usbser.sys from the following source CDC class for Atmel MCUs (many thanks to Pavel K). What is interesting, the file was actually based on the driver file for the LPC134x family. For some reason the VID/PID combinations did not work for me (some of them were for Atmel, but some seemed to be still valid for NXP). Nevertheless, the only thing I had to do was to enter the right VID/PID combination. You can download the modified "driver" here: CDC class driver for LPC1343. Now it works well with NGX Technologies mX-LPC1343-S starter kit. In case you use the CooCox to compile the USB CDC example, here goes the useful hint: in case of trouble, change the SystemCoreClock to SystemFrequency (and include system_LPC13xx.h).

SEGGER J-Link on ATSAM4S-XPLD

I have recently experienced considerable trouble related to installing SEGER J-Link driver for the on-board debugger on Atmel board on the Windows 7 64-bit machine. It may be important that I have earlier installed J-Link driver for the Freescale KwikStik board. The ATSAM4S-XPLD board support comes in form of online available archive, that contains further archives and sometimes even one more level of archives. Somewhere there is a directory called "Setting up", in which you will find the "Setup_JLinkARM_V442", you probably do not want to use it on machine similar to mine. You might also want to download the newest drivers from Segger directly, but if these are in version "Setup_JLinkARM_V458a" (as they were at the moment of writing this entry), you should also not use these. What have finally worked for me, is "Setup_JLinkARM_V459c", downloaded from the beta versions section. The older drivers were just impossible, for example windows could not install them because of "The name is already in use as either a service name or a service display name". And a final word - reboot your machine before the installation.

Saturday, December 22 2012

Problems with Xilinx I2C MicroBlaze module

When using long cables with Xilinx I2C peripherals (xps_iic or axi_iic) the bus controller may behave unexpectedly. Sometimes it just hangs during send operation, and sometimes it starts generating SCL clock signal forever. The issue seems to be related to the signal reflection from the remote end of the cable. In the particular case it was solved by mounting 22 pF capacitors to ground on both I2C lines, close to the FPGA circuit.

Thursday, November 8 2012

The logo of the Lodz University of Technology (formerly Technical University of Lodz)

What is the hardest thing to do at the Lodz University of Technology? Obviously it is finding the University logo in a fair size and quality, without compression artifacts. To solve this problem ultimately and efficiently I have made an effort to redraw the logo to a vector format. Here you can see the final result (click to see the full image size):

The logo of Technical University of Lodz (high resolution raster graphics)

The Scalable Vector Graphics (SVG) file is available for download here: TUL logo, vector format

The files are available under the Creative Commons Attribution 3.0 License. Attributing the authorship (e.g. "Original image by Aleksander Mielczarek <olek@olek.tk>") is required only for derivative works (e.g. when you correct the image and publish your own version). Plain reproduction, e.g. for presentations, documents, etc., does not require any attributions.

Tuesday, August 21 2012

Opening serial ports above COM9 (under Windows)

When you use WinAPI to open serial port with number larger than 9 (e.g.: COM10) the CreateFile function may (will?) fail, if the port name is given straight.

The proper way to specify the port is to provide the \\.\ sequence before port name, e.g.: \\.\COM10

C/C++ example: handle = CreateFile("\\\\.\\COM11", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

Sunday, July 29 2012

WriteFile reports wrong transfer sizes with FT232

There is an interesting issue that may appear when you try to communicate with FT232R virtual serial port using WinAPI. The problem probably persists for other access methods too.

Problem description: - The function WriteFile reports unusually large transfers (e.g. 4104 bytes instead of 1 byte) - It reports 'success', and GetLastError() shows nothing - Actually it sends the amount of data reported, or instead skips sending completely

If you experience the problems mentioned above - ask yourself one simple question. Haven't you connected the FTDI chip to the USB 3.0 port ?

Yes - in my case connecting it to USB 2.0 solved the problem.

(Observed on: Samsung RF711, Windows 7 64-bit, FT232RL)