2018-05-27 03:03 AM
2018-05-27 06:23 AM
https://community.st.com/0D50X00009XkY6TSAV
Use Google to find information and tutorials
Microsoft and GNU have PC based C compilers that can take C code and make executables/applications that run natively.
2018-05-28 12:46 AM
KI am using LWIP , STM32F4 and I want to iimplement an http web based on netconn API in the board.
I activated httpd from CubMX, I downloaded makefsdata.exe from internet and I generated with it the fsdata.c file..
In the fs.c generated by CubMX there is error in the fnction fs_open
in the programm of the http I am using I wrote this
file = fs_open(''/STM32F4xx_files/stm32.jpg'');
In fs.c file
err_t
fs_open(struct fs_file *file, const char *name){const struct fsdata_file *f;if ((file == NULL) || (name == NULL)) {
return ERR_ARG;}I did not understand the error exactly
You will find attached the capture of the error and the programm
thank you in advance for your help
2018-05-28 01:40 AM
2018-05-28 03:25 AM
If you read the LwIP documentation, you will find that you have to write your own custom fs_open to do what you want to do
2018-05-28 04:37 AM
else if((strncmp(buf, 'GET /STM32F4xx.html', 19) == 0)||(strncmp(buf, 'GET / ', 6) == 0))
{
/* Load STM32F4x7 page */
file = fs_open('/STM32F4xx.html');netconn_write(conn, (const unsigned char*)(file->data), (size_t)file->len, NETCONN_NOCOPY);
fs_close(file);
}
else
{
/* Load Error page */
file = fs_open(&file,'/404.html');netconn_write(conn, (const unsigned char*)(file->data), (size_t)file->len, NETCONN_NOCOPY);
fs_close(file);
}
Indeed in this htppd.c usage of fs_open is inconsistent.
If this code comes from some 'static' template, need to fix it.
Or, get updated sources from the home site of LwIP project.
-- pa
2018-05-28 04:59 AM
Yes I corrected it like this
struct netbuf *inbuf;
err_t recv_err; char* buf; u16_t buflen; struct fs_file * file;....
....
/* Check if request to get ST.gif */
if (strncmp((char const *)buf,'GET /STM32F4xx_files/ST.gif',27)==0) { recv_err = fs_open(file,'/STM32F4xx_files/ST.gif'); netconn_write(conn, (const unsigned char*)(file->data), (size_t)file->len, NETCONN_NOCOPY); fs_close(file); }But i get a warning sayin ' file may be used unitialized in this function .wht does this mean ?? it is declared u nthe begining of the function
Thank you for help
2018-05-28 05:45 AM
I got error sayin Passing argument 1 of 'fs_open' from incompatible pointer type
2018-05-28 05:46 AM
and info saying '' expected 'struct fs_file*' but argument is of type 'struct fs_file**'
what does this mean please ?
2018-05-28 06:01 AM
so what I wrote is correct ?
struct fs_file *file;
recv_err = fs_open ( fichier, '/ STM32F4xx_files / ST.gif');
but I have the same warning sayin file may be used uninitialized in this function
Like
•Show 0 Likes2018-05-28 06:47 AM
I meant file and not fichier
struct fs_file *file;
recv_err = fs_open ( fichier, '/ STM32F4xx_files / ST.gif');
is it correct ?? how can I correct it please !!?