[challenge] What a day !

I had imagined many scenarios for this day, but certainly not this one. To answer your question Drix, yes the progress animation was there. It was funny, but also very destabilizing. Could you imagine that in the preparatory exams for the Grandes Ecoles ? Every one becomes crazy ! On the one hand it is very stimulating and emulates the competition. On the other hand, it reassures you. I was not the only one to be stuck at step one in the afternoon.

In fact, my code was not robust enough and I spent many hours on debugging it. Then, I had a revelation around 5pm, which gave me only a few hours to progress on the challenge. I can still remember Sam’s eyes saying “Another one who haven’t listen…”, when he was checking my work… And he was right. After cleaning all this, the coding was more fluid. It brings me out of my grumpy mood and my bad faith.

Above all, the challenge really was a good experience. I understood a lot about debugging, and errors management in particular. I must correct the code of the practical work and make it clearer now. The more I use ChibiOS, the more I enjoy it. There is a big step to understand it in the beginning. But it turns out to be very powerful and easy to use.

At present, we have to focus on the code of our project… but not tonight.

challenge

[ChibiOS] What a day !

Today was a big day. I had to finish the implementation of a simple http client before the challenge of tomorrow, to get familiar with the LwIP stack and the netconn API. It’s almost done. I haven’t tested it with telecom-paristech.fr because the site was down for a few hours this afternoon. I tested with my laptop as a web server, only with netcat. I received the http get and the response was correctly redirected on the serial over USB channel. By the way, the port 80 seems to be blocked on the computers of the a406 room. I mean, with netcat listening to the port 80 on my laptop, I couldn’t established any connection from another computer in the room, even if both were connected with Ethernet.

I’m not inspired tonight, so I am going to continue with these little mistakes or, let’s say carelessness, I made today. The first of all dealt with endianness. I only used static IPs, so I hardcoded them. This was a really bad idea. With a little-endian processor and a big-endian network, you could imagine the disaster. Then I worked with the echo server set up by Alexis. After a few tries (at least one hour), the communication was impossible. The server was down. About this point, I plead guilty.

But this is nothing compared to the netconn API documentation. Between the ambiguity of the explanations, the broken links, and the “@todo explain netbuf”, I was completely lost. I allocated memory for the buffers where I should not, I used functions reserved to UDP…

Anyway, this is over. I give you another funny picture, from Geek & Poke this time.

Endianness (from http://geek-and-poke.com/)

[ChibiOS] Multithreading

After the anger comes the frustration. After being stuck a few days on the serial over USB implementation on ChibiOS, I finally did it ! It was yesterday evening. I was in a good mood this morning. Actually, making a success of compiling and flashing a demo code is not very glorious. The rules are clear : no black magic ! However, after many comparisons with my original code, I could not figure out where were my mistakes.

The general survey and advice of today have been helpful. My problems came from the multithreading. Firstly, I thought that when main returns, it would be sleeping forever. In fact, it seems to be stuck in an infinite active loop. Because of this active wait, the serial over UBS, which had the same priority, could not be executed properly. (The management of SDU was made in a thread, not in the main function) Instead I saw a lot of 110 errors in dmesg. 110 means “not enough power supply to provide to the device”. It logical from the point of view of the host. The STM32 acted like it was establishing a connection, and stopping. And started a new one and so on, like a device which is constantly rebooting because it not powered enough.

A few patches later, it is now working properly. I am pretty impressed by the shell. It is very easy to enable and customize. You can add you own commands, see the number of threads, the state of the memory. Very useful.

Well, I hope I will remember this episode during my future debugs. I leave you with this picture you might have already seen.

Multithreading

Multithreading: Expectations vs Reality