Forum Discussion
NiosII
hi
I have a source code of compression vidéo (h.264 ,jpeg) how is exécutable in visual studio c++,my problem is how to implement this code in NiosII ,how to convert this source code in niosII. thanks in advance.68 Replies
- Altera_Forum
Honored Contributor
No, I didn't mean using the flash, I meant not using files at all and just keep the data in memory. What do you want to do to the compressed data once you compressed it? Do you really need to write it to flash?
- Altera_Forum
Honored Contributor
hi Daixiwen,thanks a lot.
how to keep the data in memory(not falsh memory)? i need to write the compressed data(.jpg) in the flash memory (if it is possible and easy).because after write in flash memory i want to read with a web server (...). i can write a file in flash memory?? thanks in advance. - Altera_Forum
Honored Contributor
Your code probably use fwrite() to write the data to a file. Instead of doing this, just keep the buffer allocated. You can probably modify the web server code to use a pointer to that buffer and directly return its contents instead of reading a file on the system.
- Altera_Forum
Honored Contributor
thanks a lot Daixiwen.
if i use the buffer allocated I must call a file in the memory as in include in the memory.h file in visual studio, so what is the file called when I use the buffer in the environment NiosII? thanks in advance. - Altera_Forum
Honored Contributor
I have no idea what the memory.h file includes, it doesn't seem to be standard C. In C you can just use the standard malloc() and free() functions to allocate or free a buffer.
- Altera_Forum
Honored Contributor
hi Daixiwen,
when i allocated the data in memory using the buffer ,so how to read the data? thanks in advance. - Altera_Forum
Honored Contributor
all right then.
this is not good answer. but still a way. why don't you use "printf" to show your data on your nios2-terminal. just print your result sequentially. and analyze it after you store the data into text file. as I told you, this is not good way. but, since we don't know (you may not know) what device your FPGA has. we can not tell what you can do. do you have MMC(SD-card) device on your FPGA? can you connect FAT formated USB-Memory? do you have Ethernet adopter and able to send data via that? I don't think so. that's why, we can not advice. - Altera_Forum
Honored Contributor
thanks Akira, yes i have Ethernet adopter and able to send data via fpga and pc. my data is a image(.jpg), i write the data in flash memory but i don't know how to read the data and display this data(image .jpg) from the flash memory:
if i write a integer(i=10) in the flash memory i can read it with printf(i). but when i write a file in flash memory, i don't know how to display it?? thanks in advance. - Altera_Forum
Honored Contributor
hum, interesting.
you have Ethernet connection, but not be able to write a file. anyway 1. flash file. you can not open file on the flash memory. because,( I think ) your system does not have FAT access. 2.Network you say you can send data via Ethernet. all right why don't you use it. when your program tries to write jpeg data, your code must have compressed image on you memory(ram) right? then send whole those data to you computer via Ethernet. I can't tell why you can not save files on your flash because I don't know how do you construct your system. I don't know if sending data via Ethernet satisfies your request, but you can make sure your jpeg-program works or not. how about that? - Altera_Forum
Honored Contributor
hi akira,thanks a lot,how i can't write the data (image file .jpg)in flash memory ?
i want to write a file(.jpg) in flash memory then read and display this file. so what should i add to be able to read the file? if i write the data in memory Ram ,this is the same problem (how to read and display this file!!) thanks in advance.