TCPIP Stack Bug

This week I continue trying to figure out how to ‘download’ a huge file with TCP protocol. Set up a USB cdc com port to ease debugging. Fixing ‘init_b’ staying LOW. TCP Server looping READ socket To be able to ‘download’ or I should say read a file being uploaded by a CLIENT is to loop the socket READ state. Continuously looping the READ & WRITE socket, both CLIENT and TCP Server (PIC32) will automatically communicate packet by packet of Read more

More Improvements

More on cURLpp I talked about cURLpp in my last post. There’s much more to it than just uploading files to Google Drive endpoints. A few things I discovered is :- curlpp::infos This allows certain response info to be obtained directly. There are a list of info obtained, which can be referred from “curlpp/include/Infos.hpp”. A more useful one would be ResponseCode, which is great to have. After request.perform(), long responseCode; curlpp::infos::ResponseCode::get(req,responseCode); and you can use the responseCode as you please. WriteStream There Read more

Null Termination Issue

This week I have been trying to make the read and readstring function working in the simulator. There are two main problems: Read function can only return the same data byte every time it is called. For example, when a string “HELLO” is written to the data register, read function can only return the last character of the string, which is ‘O’ or 79 in ASCII. Readstring function continued to read each byte of data without stopping. This is because Read more

PIC32MZ TCPIP Server

This week I integrate my previous TLS TCP Server code onto ‘the board’ – PIC32MZ. DHCP enabled & Fixed IP adress test First I experiment with having DHCP enabled on MHC. Using ‘tcpip_discoverer’ from Harmony to fetch the assign IP address. java -jar tcpip_discoverer.jar The discoverer tool is very useful to fetch the IP address. Next is to disabled DHCP, to have a fixed IP address test. Both test passes. *Harmony > tcpip examples project was used Self sign CERTIFICATES Reusing the Read more

Object Mapping Issues

This week I am rewriting the read and write functions in C programming for UART. Dr Shawn really taught me a lot about the easy and correct way to write the codes. Next I need to make sure that the information are stored to the respective address correctly when the instructions are called. For this case, an objectMapping object will be created in JavaScript to map the address and values. However, the object mapping object was not created by the JavaScript Read more

Adopting cURLpp

So.. I was using system() to perform CURL requests in my application. There were a few downsides to this:- Error handling of response. Messy codes. My boss talked about using the cURLpp library to replace the existing system() curl mechanism. So this week I tried my hand on it in my Wt Application. Examples There are plenty of cURLpp examples available in the git repo. However, the documentation is quite lacking. For some usage that is not shown in the examples, Read more

Registers for UART, SPI and TWI

This week Dr Shawn has explained to me the internal registers of UART, SPI and TWI. Basically these modules has two registers: status register and data register. Status register, from its name we know that this register contains information about the state of the device. Data register contains the data to be stored or to be fetched. For each module, I need to implement flags to check the status of the device whether it is ready to perform data transmission Read more

UART in Simulator

This week I am working with UART (Universal asynchronous receiver/transmitter). UART is a device that used for serial communication over a peripheral device serial port or computer. UART takes bytes of data and transmits the individual bits in a sequential fashion. UART consists of a data bus with several data lines (usually 8) with control pins for read/write and two serial wires which are TX (Transmit) and RX (Receive). Note that the connection between UART must be carefully and correctly connected. Read more

Configure FPGA with slave serial method

This week I try to fix ‘init_b’ low and get the configuration of spartan 6 working. ‘init_b’ turn high Finally manage to read a HIGH output from ‘init_b’ of FPGA. The solution was to have PIC32 enabled ‘pull_up’ on the input pin and some additional pic32 initialization set up. Next is to toggle ‘program_b’ to check whether ‘init_b’ will go low (following the data timing of ug380), and indeed it works. SPI initialization Based on the example of ‘spi_loopback’ from Read more

Software Test

Software test is all about breaking the application, which can be hard sometimes when there is an emotional attachment. My colleague Peter and previous interns working on the project have done a great job and their code is working fine. For my part, i need to make sure p3muka, the user project management application does its job. Http::Client and Curl Before the access_token expires, a batch project file sync is initiated. Since the upload is handled completely by WResource, it Read more