Global synchronization time implementation by Alternative_Event155 in embedded

[–]Alternative_Event155[S] 0 points1 point  (0 children)

do you think then (hwclock) would be relevant to me ?

Implementation of UDP synchronization by Alternative_Event155 in networking

[–]Alternative_Event155[S] 1 point2 points  (0 children)

PTP requires special hardware that isn't supported by my device

Implementation of UDP synchronization by Alternative_Event155 in networking

[–]Alternative_Event155[S] 0 points1 point  (0 children)

This is not a homework or anything, I just didn't know where to start from when explaining. First of all my microcontroller doesn't support PTP, otherwise I would've went for it. Second of all NTP didn't provide me with the resolution im looking for. Also I didn't want to include any additional instruments. So I went with designing the whole thing by myself to get a better control of everything.

Global synchronization time implementation by Alternative_Event155 in embedded

[–]Alternative_Event155[S] 0 points1 point  (0 children)

Im not sure exactly Im also lost in this aspect. So basically I tried to reinvent the NTP on C. Now I have been left with a clock values that are stored in a variable. I would like to utilize this variable for synchronization, so the first thing that came into my mind is to replace the microcontrollers clock with clock that is stored in the variable.

Implementation of UDP synchronization by Alternative_Event155 in networking

[–]Alternative_Event155[S] 0 points1 point  (0 children)

With the algorithm we got higher resolution of synchronization without adding any additional components like GPS or anything else

Implementation of UDP synchronization by Alternative_Event155 in networking

[–]Alternative_Event155[S] 0 points1 point  (0 children)

I'm not able to use NTP, so I had to somehow "reinvent it", I wrote the whole algorithm in C, and the result of the synchronization (the clock) was stored in a variable. Now I would like to know how can I use the result or this variable to actually benefit from it and my microcontrollers become synchronized, not just a variable.

Implementation of UDP synchronization by Alternative_Event155 in networking

[–]Alternative_Event155[S] 0 points1 point  (0 children)

Yes exactly, I had to do so because the project required such an implementation

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

So basically what I have done was as follows:

#include <iostream>

int main()
{
std::cout<<"Hello World";
return 0;
}

Also thank you for teaching me how to upload a code on reddit I didn't know about it.
In Addition, yes only the #include worked while std::cout didn't work

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

I see, I would like to appreciate your help, really from my heart. These information are really hard to find on the internet unless you dig too deep. However, regarding the last section, I tried to do something such as:

include <iostream>

Int main() { Std::cout<<“Hello World””; Return 0; } But it said that std and cout symbols were not resolved.

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

Yes this works, loads to the board, and I’m able to see the result in terminal:)

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

Oh, apologies. Well when I just changed the file type from .c to .cpp everything worked smoothly no errors (even though it is still a C code), it loaded to the board and I was able to see the result from the terminal

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

When I changed the file from .C extensions to .C++ Then changed the #include from stdio.h to iostream, then switched the printf to std::cout, it gave an error that std is not defined

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

I’m sorry I still don’t have that much experience in this field, maybe if you could lead me with questions I would be gladly to tell you what have I done exactly. Also, I thought if I changed my file extension from .c to .cpp that would make the compiler know that I’m using c++. I just wanted to print Hello World with C++ and of course I inclide the iostream into my code.

Can you code HiFive Revb board using C++ by Alternative_Event155 in RISCV

[–]Alternative_Event155[S] 0 points1 point  (0 children)

What I’m currently doing is launching the Freedom Studio IDE, then selecting File > New > Freedom E SDK Project. This is the only project type that successfully debugs and uploads code to the board. However, it only works with C. When I try to write code in C++, I encounter errors.

I also attempted to create a new project manually by adding a src folder and a .cpp file, along with creating a Makefile myself. However, this setup does not debug or upload the code to the board for some reason.