Setting sdkconfig using platform.io for the ESP32 - esp32

I was wondering if anybody managed to set the SDKConfig.h file for the ESP32 when using platform.io to upload code, and if so how it is done.
Thanks in advance!
✌️

You can copy and modify the file SDKConfig.h into your project include folder from:
/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config/
or paste "CONFIG_ULP_COPROC_RESERVE_MEM" in your code and <Ctrl+LClick> to go to this file in your system.
And add this to your platformio.ini so that the file in your project has priority
build_flags =
-Iinclude
Tested with framework-arduinoespressif32 Version 3.10006.210326 (1.0.6)
Let me know if it works for you, I'm guessing it could work with the other frameworks?
if some of the definitions gives you a problem because they are defined elsewhere just add a guard like this:
#ifndef CONFIG_FLASHMODE_DIO
#define CONFIG_FLASHMODE_DIO 1
#endif

Related

Writing .cargo/config.toml to allow rust code to be imported by python

I'm using rust-cpython to make a python module in rust. I've run my code on a linux os and it runs just fine but I get the familiar "linking with cc failed:exit code 1 error". I've gathered from this that I need to add the .cargo/config file to my project as suggested at the bottom of this:
https://github.com/dgrunwald/rust-cpython
I've copied and pasted their code into a file, config.toml, and place there in a directory, .cargo. I've tried nesting this in my src directory and my project directory with no success, what am I missing?
Solution found: Thought I'd post it as this gave me grief.
Everything with this setup is fine except the config file can't have the extension .toml despite being written in a toml format

Error(s) in building Veins-LTE: OperationalBase.h not found

I am trying to build Veins-LTE 1.3, which includes inet, simulte and veins for LTE-based vehicular networks simulations.
By following the README, I get into the root package and write:
make makefiles //this creates the required Makefile in inet, veins and simulte
make
This last command, however, results into a fatal error in building inet:
In file included from applications/common/ApplicationBase.h:21:10:
fatal error: 'OperationalBase.h': file not found
By opening the file 'inet/src/applications/common/ApplicationBase.h', I immediately realize that the problem lies in the inclusion of the 'OperationalBase.h', which, as a matter of fact, is not present in the same directory. Instead, it can be found in the 'inet/src/base/' directory.
Omnet++ : 5.2.
Veins-LTE: inet 2.3.0, veins 2.1bis, simulte 0.9.1
SUMO: 0.30.0 (if this could be relevant)
Environment: Ubuntu 16.04.1 - amd64
I am perfectly conscious that a similar question already exists here, but it has not received answers nor comments since last August, so..
WHAT I TRIED TO DO:
My first action was simply to change the path in the include statement so that to point to the right folder: #include "../../base/OperationalBase.h"; this actually shifts the problem elsewhere, since all the other source files in the 'inet' framework inside the veins-lte package do not include the full paths of the required header files (i.e., they seem to assume all the .h files are inside the same directory). Moreover, the omnetpp methods are not recognized, since no using namespace omnetpp is present.
I had a look at 'inet/Makefile' file; in particular, after changing to the 'src/' folder, the opp_makemake command comes with the following options:
opp_makemake -f --deep --make-so -o inet -O out -pINET -
Xapplications/voipstream -Xtransport/tcp_lwip -Xtransport/tcp_nsc -
DWITH_TCP_COMMON .... and other stuff sounding like -DWITH_
As per the opp_makemake documentation (opp_makemake), the --deep option should cater for deep includes. Does it mean that the full (or relative to src/) path of the .h file to be included is not required? The only source folders that are excluded seem to be transport/tcp_lwip, applications/voipstream, transport/tcp_nsc.
So, should I modify all source files by writing the full/relative path of the included files?
Is there a better, smarter, more centralized way to achieve this goal, maybe by modifying something in the inet/Makefile file?
Am I missing something very obvious?
Thank You
WHAT I AM ABLE TO DO:
Successfully run the Omnet++ TicToc examples;
Successfully run the veins RSU Example (by using the stand-alone veins
release)
Successfully run basic SUMO examples.

Undefined reference for a specific library: FastNoiseSIMD

I'm new to C++ and I'm trying to include a header file from this library, https://github.com/Auburns/FastNoiseSIMD
When I write this line, FastNoiseSIMD* myNoise = FastNoiseSIMD::NewFastNoiseSIMD(); I get the error: main.cpp:36: undefined reference to FastNoiseSIMD::NewFastNoiseSIMD(int)
Here is how I'm including the header:
#include "FastNoiseSIMD/FastNoiseSIMD/FastNoiseSIMD.h"
As you can see, the files are in folders that are located in the working directory of my program. I'm working on Linux using c++11 and g++. I don't see any library files that I need to link so I'm stuck here.
Any help is greatly appreciated. Thank you.
Check this undefined-reference-to-pow-and-floor

Adding and compiling new code in the linux kernel

This may sound like a very noob question.
I'm trying to implement a UDP-based protocol in the linux kernel. I was following the UDPLite protocol implementation as a reference.
Step 1
I created a new_protocol.c in net/ipv4/
This file has a function
void _init protocol_init(void){*Code here*}
I also used
#include "udp_impl.h"
in this file as I was using some functions from the UDP protocol
Step 2
I modified the file net/ipv4/udp_impl.h to include net/new_protocol.h
Step 3
I created the file include/net/new_protocol.h where I defined the function
void protocol_init(void);
Step 4
Finally, I called the function in net/ipv4/af_inet.c. Also, I gave an include statement in this file for net/new_protocol.h
Now when I try to build the kernel, I get an error saying
undefined reference to `protocol_init()'
What am I missing here? Is my way of including header files incorrect? Do I need to include some info in the makefile to pick up the new net/ipv4/protocol.c?
Do I need to include some info in the makefile to pick up the new net/ipv4/protocol.c?
Yes, you need. Kernel build system doesn't autodetect source files, all of them should be listed explicitely in appropriate Makefile. In you case you need to modify net/ipv4/Makefile.
Makefiles used for kernel build are described in file Documentation/kbuild/makefiles.txt.
I just needed to add protocol.o in the makefile in net/ipv4/

Foundation.h on Windows

I know these questions have been asked before but everything suggest using GNUStep. Is there a way to use Foundation without GNUStep? This is also a learning question for me (like if it's possible to do by linking files or something)
I have Cygwin and gcc installed. I got all the Libraries from CocoaTron as in here: http://code.google.com/p/cocotron/source/browse/
I added the library folder to the OBJC_INCLUDE_PATH and the C_INCLUDE_PATH and it doesn't complain about not being able to find Foundation.h anymore.
But I get other errors like:
$ gcc intro.m -o intro
In file included from /cocoa/CoreFoundation/CFBase.h:144,
from /cocoa/CoreFoundation/CFAttributedString.h:8,
from /cocoa/CoreFoundation/CoreFoundation.h:42,
from /cocoa/Foundation/Foundation.h:37,
from car.h:1,
from intro.m:2:
/cocoa/CoreFoundation/CFString.h:88: error: parse error before "va_list"
In file included from /cocoa/Foundation/NSAffineTransform.h:9,
from /cocoa/Foundation/Foundation.h:41,
from car.h:1,
from intro.m:2:
/cocoa/Foundation/NSGeometry.h:9:32: Foundation/NSObject.h: No such file or directory
In file included from /cygdrive/d/Allebrum Resources/C Libraries/cocoa/Foundation/NSAffineTransform.h:9,
from /cygdrive/d/Allebrum Resources/C Libraries/cocoa/Foundation/Foundation.h:41,
from car.h:1,
from intro.m:2:
I'm sorry for the novice question, I was just interested in running a few test and didn't want to install GNUStep.
I mean, a really simple example like:
//car.h
#import <Foundation/Foundation.h>
#interface Car : NSObject{
}
- (void)addGas;
#end
#include <stdio.h>
#import "car.h"
int main(int argc, const char * argv[]){
printf("Hello");
return 0;
}
Yes, I know this example doesn't need objC ;) I was just trying to follow along with a tutorial.
Thanks for the help!
Looking at the Cocotron's requirements page and general information page, it seems that it only supports development on the Mac. What it provides is the ability to build a Windows- or Linux-compatible product… on your Mac.
So, as far as I can tell, at this time, you can't use Cocotron to develop on Windows. You'll still have to use GNUstep.

Resources