Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add steps for compiling the kernel #104

Closed
Skyluker4 opened this issue Feb 11, 2019 · 4 comments
Closed

Add steps for compiling the kernel #104

Skyluker4 opened this issue Feb 11, 2019 · 4 comments

Comments

@Skyluker4
Copy link

Skyluker4 commented Feb 11, 2019

Edit from PROS Team: This method of including the SDK from VCS is unsupported. VCS uses a different SDK from that given to third-party developers and functionality within PROS may break.

Expand It is possible for anyone to compile the kernel, it just requires a few extra steps. VCS actually ships with the SDK and can be added to PROS.

Steps:

  1. Download Vex Coding Studio
  2. Copy the libv5rt header files (the ones prefixed with "v5_") from where the VCS SDK is installed to [pros source folder]/firmware/libv5rts/sdk/vexv5/include/
  • In Windows they are in %localappdata%/VEX Coding Studio/VEX Coding Studio/sdk/vexv5/include/
  1. Copy the prosv5rt library (libv5rt.a) to [pros source folder]/firmware/libv5rts/sdk/vexv5/ and rename it to libv5rts.a
  • In Windows it is located in the folder %localappdata%/VEX Coding Studio/VEX Coding Studio/sdk/vexv5/
  1. Define the function vexBackgroundProcessing defined in v5_api.h.
  • Create the source file [pros source folder]/src/libv5rts/sdk/vexv5/v5_api.c and add the following code:
#include "v5_api.h"

#pragma GCC push_options
#pragma GCC optimize("O1")
void vexBackgroundProcessing(void) {
    __asm__ ("ldr r3, [pc, #4]");
    __asm__ ("ldr r3, [r3, #92]");
    __asm__ ("bx r3");
    __asm__ ("cmneq pc, #0");
}
#pragma GCC pop_options
  • and edit v5_api.h so that the function declaration is
void                  vexBackgroundProcessing( void ) __attribute__((naked));
  1. Compile with prosv5 make

Solution

Update the readme to include steps on how to compile the kernel and possibly add the code above to the repo so anyone can build the kernel themselves.

@Jerrylum
Copy link
Contributor

Jerrylum commented Feb 11, 2019

image
It is work, at least in the compiler
I haven't used in the Brain yeah.

Also, I think the library probably have VCS's method too.

@Jerrylum
Copy link
Contributor

Jerrylum commented Feb 11, 2019

Expand That's how I made it

Steps:

  1. Download Vex Coding Studio and run the program at least once

so the Studio can init itself.

  1. Copy the libv5rt header files to [pros source folder]\include\

libv5rt header files is in %appdata%\Local\VEX Coding Studio\VEX Coding Studio\sdk\vexv5\include. You only need files with "v5_" prefixed. (v5.h to v5_vcs_options.h)

  1. Copy the libv5rt.a to [pros source folder]\firmware\libv5rts\sdk\vexv5, and rename it to libv5rts.a

libv5rt.a is in %appdata%\Local\VEX Coding Studio\VEX Coding Studio\sdk\vexv5

  1. Create file v5_api.c in [pros source folder]\src\system\ and add the following code:
#include "v5_api.h"

#pragma GCC push_options
#pragma GCC optimize("O1")
void vexBackgroundProcessing(void) {
    __asm__ ("ldr r3, [pc, #4]");
    __asm__ ("ldr r3, [r3, #92]");
    __asm__ ("bx r3");
    __asm__ ("cmneq pc, #0");
}
#pragma GCC pop_options
  1. Edit v5_api.h so that the function declaration is
void                  vexBackgroundProcessing( void ) __attribute__((naked));

v5_api.h is in the *[pros source folder]\include*

  1. Compile with prosv5 make

@Jerrylum
Copy link
Contributor

Jerrylum commented Feb 11, 2019

image
image

I tested about it, you can use the raw method on VEX CODE STUDIO but PROS can't. Also, the library has VEX CODE STUDIO's methods

raw method mean The super security VEX's proprietary Software Development Kit

What it means?

you can write VCS code on the Notepad++ and compile or upload it using PROS CLI. OR
write your own code without PROS kernel. OR
add VCS support on the PROS Kernel. OR
use PROS API and SDK in your project.

Finally, it is no reason to private the SDK right now.

@HotelCalifornia
Copy link
Contributor

We do not distribute the SDK because it is proprietary and owned by VEX. We can't stop you from doing this on your own, but we're also not going to support it.

@purduesigbots purduesigbots locked as off-topic and limited conversation to collaborators Feb 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants