-
Notifications
You must be signed in to change notification settings - Fork 6
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
Samsung B310E #9
Comments
Try running You complain, but you don't give specifics on what stage the problem occurs.
Everything - what exactly? You run some command, you get some output. Something happens, or maybe it doesn't happen. Describe it. |
I just ran usb/fptest.bin and the command spd_dump ran successfully but the phone is still just a black screen command: output:
|
Because you need to compile the program from the libc_server folder. And run it after This is my template script for launching games: #!/bin/bash
game="test"
run_game() {
./spd_dump \
fdl nor_fdl1.bin 0x40004000 \
fdl fp$game.bin ram
test $? = 0 && cd workdir && {
../libc_server -- $@
cd ..
}
}
make all && {
args="$game 123 456 789"
run_game --bright 50 --charge 2 $args
} The current directory should contain:
|
I had a run_doom.sh and I copied ur commands to it |
Makefile is something like this. But you can just manually move the listed files. .PHONY: all clean
all: spd_dump/spd_dump libc_server/libc_server
clean:
$(MAKE) -C spd_dump clean
$(MAKE) -C libc_server clean
spd_dump/spd_dump:
$(MAKE) -C spd_dump
libc_server/libc_server:
$(MAKE) -C libc_server Example script for launching Doom: #!/bin/bash
game="doom"
run_game() {
./spd_dump \
fdl nor_fdl1.bin 0x40004000 \
fdl fp$game.bin ram
test $? = 0 && cd workdir && {
../libc_server -- $@
cd ..
}
}
make all && {
#args="$game -timedemo demo1"
args="$game"
run_game --bright 50 --rotate 3 --charge 2 $args
} You must have a |
This makefile does not match the script paths. I just have many different script variants around. The script corresponding to this makefile will be like this: #!/bin/bash
game="doom"
run_game() {
spd_dump/spd_dump \
fdl nor_fdl1.bin 0x40004000 \
fdl fp$game.bin ram
test $? = 0 && cd workdir_$game && {
../libc_server/libc_server -- $@
cd ..
}
}
make && {
args="$game"
run_game --bright 50 --rotate 3 --charge 2 $args
} |
running this (without make cuz it not work messed up directories) #!/bin/bash
game="doom"
run_game() {
./spd_dump \
fdl nor_fdl1.bin 0x40004000 \
fdl fp$game.bin ram
test $? = 0 && cd workdir && {
../libc_server -- $@
cd ..
}
}
args="$game 123 456 789"
run_game --bright 50 --charge 2 $args and this time I would get this:
note: I have the shareware doom1.wad in my workdir ;) |
This is strange, the "timeout reached" message can only be output by |
Add
Don't put all the output (there will be a lot) in the response, just the last lines. If everything is correct it should end like this:
|
actually I did this before (the --verbose 2)
it never did this timeout thing before... |
This is: BSL_CMD_EXEC_DATA = 0x04, /* Execute from a certain address */ Means that the game binary is loaded into the phone's RAM and is running, but it is not responding. Are you sure you are using the USB binary and not the one from the Try running |
I have been literally using the sd card one lol output:
|
There were similar problems in issue 8, when the code hung at the start. On my B310E, the log starts like this and continues:
|
Can you compile the |
I have only made a simple game in C and Raylib |
should I enable something like SPI? |
Get Extract it anywhere. Create a link to Now use this script, let's call it #!/bin/bash
NDK=$HOME/android-ndk-r26d
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm
CLANG=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang
cd fpdoom
test -f pack_reloc/pack_reloc || make -C pack_reloc
cd fptest && {
make clean all TOOLCHAIN=$TOOLCHAIN CC=$CLANG LIBC_SDIO=0 2>&1 | tee ../../build.log
cp fptest.bin ../..
} |
just did that and used the manually compiled fptest.bin and now it's still as before |
Now to the last messages in the log. They are from the Lines 934 to 946 in 8169157
After that Try making the following changes to syscode.c and recompiling fptest.bin: #endif
MEM4(addr) = val;
} else break;
+ DBG_LOG("pinmap_trace: 0x%08x, 0x%08x\n", addr, val);
+ sys_wait_ms(500);
}
if (sys_data.gpio_init)
gpio_init((void*)pinmap); |
DBG_LOG("pinmap_trace: 0x%08x, 0x%08x\n", addr, val);
sys_wait_ms(500); This will print out how the CPU pins are initializing. It will wait half a second after each change. So we'll find what was last before the hang. |
I pressed Ctrl+C thinking it was infinite, sorry will do again and give u result ;) |
|
Next there should be the following values (judging by the firmware of my B310E, the previous ones match):
Which are different because 0x82001xxx are analog die registers. At the beginning of
Try replacing I'll try to find what these registers refer to. |
I just changed CHECK_ADI to 1 and compiled the code... same exact output! |
I've noticed some weird code in the firmware for the SC6530 that doesn't seem to do anything, but may be needed for some versions of the chip: Lines 46 to 49 in 8169157
Try changing If this doesn't change anything, try skipping the initialization of these pins: } else break;
DBG_LOG("pinmap_trace: 0x%08x, 0x%08x\n", addr, val);
- sys_wait_ms(500);
+ //sys_wait_ms(500);
+ if (addr == 0x8c0002a4) break;
} |
ok so the second one didn't change anything but the first one (the #if one) actually did this:
different output! but still black screen |
I'm just a simple C guy who made an x86 OS that prints hi (using 0xb8000) |
Try putting a trace print here. For example like this: DBG_LOG("lcm_init trace 1\n"); Check if the execution reaches this point. If it does, then place prints between the following lines to find where it hangs. In fact, we are now doing printf debugging, which many people despise. But we do not have any tools to do it differently. |
ngl the printf debugging method is the best in my opinion |
In issue 8, execution would get to this point and hang due to initialization of a certain pin, which would cause a hang after a short time. That's why I suggested putting a wait between trace prints when initializing pins. The pins are initialized according to the table from the firmware, because phones can be very different with different settings. |
so we activate it? |
I think communicating using github issues is way too slow |
Try inserting an infinite timer report before void sys_init(void) {
init_charger();
init_chip_id();
+ for (;;) {
+ DBG_LOG("time: %u ms\n", sys_timer_ms());
+ sys_wait_ms(50);
+ }
pin_init(); |
it looks like the timer is going forever... |
since doom is working on your b310e can you send me your files? (nor_fdl1.bin, fpdoom.bin, etc...) |
disabling the timer made the fptest.bin work??? I have no idea but thanks for ur help! |
to anyone who was wondering... just fix the damn watchdog timer!!! or check the pin that's causing issues and skip it maybe |
Did you get it working? What did you do exactly? Did you use my examples on disabling the watchdog timer from issue 8? |
Actually have no idea! here is the whole code: syscode.c: diff --git a/fpdoom/init_sc6530.h b/fpdoom/init_sc6530.h
index 5d52872..4aca5ac 100644
--- a/fpdoom/init_sc6530.h
+++ b/fpdoom/init_sc6530.h
@@ -43,7 +43,7 @@ static void sc6530_init_smc(void) {
static void sc6530_init_freq(void) {
uint32_t a;
-#if 0 // what's this?
+#if 1 // what's this?
MEM4(0x8b0000a0) = -2;
MEM4(0x8b0000a8) = -2;
#endif
diff --git a/fpdoom/syscode.c b/fpdoom/syscode.c
index 15a005f..5d17745 100644
--- a/fpdoom/syscode.c
+++ b/fpdoom/syscode.c
@@ -16,7 +16,7 @@
#define IS_SC6530 (_chip == 3)
#ifndef CHECK_ADI
-#define CHECK_ADI 0
+#define CHECK_ADI 1
#endif
#if CHECK_ADI
@@ -175,7 +175,8 @@ static void pin_init(void) {
if (addr - 0x82001000 < 0x1000) {
adi_write(addr, val & 0xffff);
} else if (addr >> 12 == 0x8c000) {
- if (addr == sc6530_fix) continue;
+ //if (addr == sc6530_fix) continue;
+ if (addr == 0x8c0002a4) continue;
if (_chip == 1 && addr - 0x8c000114 <= 0x18) {
// ANA_LDO_SF_REG0
if (adi_read(0x8200148c) & 1 << 9)
@@ -185,6 +186,9 @@ static void pin_init(void) {
}
MEM4(addr) = val;
} else break;
+ DBG_LOG("pinmap_trace: 0x%08x, 0x%08x\n", addr, val);
+ //sys_wait_ms(1000);
+ if (addr == 0xc0002a4) break;
}
if (sys_data.gpio_init)
gpio_init((void*)pinmap);
@@ -499,7 +503,9 @@ static const lcd_config_t* lcm_init(void) {
LCM_CR(0x10) = 1;
LCM_CR(0x14) = 0xa50100;
- if (IS_SC6530 || !is_whtled_on()) lcm_reset(32, 0);
+ //if (IS_SC6530 || !is_whtled_on()) lcm_reset(32, 0);
+
+ DBG_LOG("lcm_init trace 1\n");
clk_rate = get_ahb_freq();
DBG_LOG("LCD: clk_rate = %u\n", clk_rate);
@@ -934,6 +940,10 @@ static void init_charger(void) {
void sys_init(void) {
init_charger();
init_chip_id();
+ //for (;;) { // uncomment to test timer
+ // DBG_LOG("time: %u ms\n", sys_timer_ms());
+ // sys_wait_ms(50);
+ //}
pin_init();
lcd_init(lcm_init());
lcd_appinit(); |
also can you walk me through using the SD card? (using fpmenu) |
Please don't post all thousand lines of code, that's what If the old binaries now work for you, then the problem and its solution have nothing to do with these changes. |
no the old ones don't work the ones compiled with the code I sent u do work |
Here is a script that will recompile all the binaries (will be in the #!/bin/bash
NDK=$HOME/android-ndk-r26d
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm
CLANG=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang
cd fpdoom && {
test -f pack_reloc/pack_reloc || make -C pack_reloc
make -f release.make clean all ZIPDIR=../zipdir TOOLCHAIN=$TOOLCHAIN CC=$CLANG 2>&1 | tee ../build-release.log
} A |
I just defined LIBC_SDIO=3 to the make command |
I'm goin to school but I don't have much today so I'll be back around 3 hours later |
Use the script from this comment to rebuild all binaries. Read Find a microSD card up to 32GB, it must be formatted in FAT32, some new cards come formatted in exFAT. Write the Write To check, insert the card into the phone and run via USB:
How to patch the firmware is written in |
so I have an 8GB sd card that I formatted in FAT32, the menu works but when I enter doom 1 the screen is black... then the backlight turns off then finally it goes to charging mode |
I see now... I should rename games/doom/doom1.wad to games/doom1/doom1.wad |
Should be "games/doom1/doom1.wad". The directory name is specified in
|
I just used the fphelper sdboot guide but now I how do I boot into the sd card instead of the normal OS? |
This is explained in the
For B310E should be this:
Turn off the phone, then hold one of the sdboot keys, and then hold the power key. |
it works now but the nes emulator keeps crashing... I'll see what I can do and if I can't figure out the problem I'll post here |
I got it working now (another path issue) |
I'm porting Snes9x now. |
I wanna port stuff like u |
You can examine the Try to minimize the changes required to the B310E. Remove all changes (make a backup of the current fpdoom folder and make a new one without changes) and try the fixes below separately. Are both really needed or just one? fpdoom/init_sc6530.h: static void sc6530_init_freq(void) {
uint32_t a;
-#if 0 // what's this?
+#if 1 // what's this?
MEM4(0x8b0000a0) = -2;
MEM4(0x8b0000a8) = -2;
#endif fpdoom/syscode.c: } else if (addr >> 12 == 0x8c000) {
- if (addr == sc6530_fix) continue;
+ if (addr == 0x8c0002a4) continue;
if (_chip == 1 && addr - 0x8c000114 <= 0x18) { |
trying... |
happy news! the syscode.c one worked prefectly!!! |
0x2a4 is the UART TX pin. Try this static void pin_init(void) {
const volatile uint32_t *pinmap = pinmap_addr;
// skip specific pin for SC6530/SC6530C
// hangs shortly after this pin is enabled
// the value that causes the hang is 0x231
uint32_t sc6530_fix = 0;
if (IS_SC6530) {
// workaround for Samsung GT-E1272
sc6530_fix = 0x8c000290; // SPI0 pin
if (MEM4(0x205003fc) << 16) // SC6530C
// workaround for Samsung B310E
sc6530_fix += 0x2a4 - 0x290; // UART TX pin
}
for (;;) {
uint32_t addr = pinmap[0], val = pinmap[1];
pinmap += 2;
if (addr - 0x82001000 < 0x1000) {
adi_write(addr, val & 0xffff);
} else if (addr >> 12 == 0x8c000) {
if (addr == sc6530_fix) continue;
if (_chip == 1 && addr - 0x8c000114 <= 0x18) {
// ANA_LDO_SF_REG0
if (adi_read(0x8200148c) & 1 << 9)
val |= 0x200000;
else if (sys_data.chip_id.ver == 0xa0001)
val |= 0x280000;
}
MEM4(addr) = val;
} else break;
}
if (sys_data.gpio_init)
gpio_init((void*)pinmap);
} |
Maybe it happens because UART is enabled when its pin is reconfigured. static void pin_init(void) {
const volatile uint32_t *pinmap = pinmap_addr;
uint32_t sc6530_fix = 0;
if (IS_SC6530) {
sc6530_fix = 0x8c000290; // SPI0 pin
MEM4(0x8b0000a4) = 0xc00; // disable UART
}
for (;;) {
uint32_t addr = pinmap[0], val = pinmap[1];
pinmap += 2;
if (addr - 0x82001000 < 0x1000) {
adi_write(addr, val & 0xffff);
} else if (addr >> 12 == 0x8c000) {
if (addr == sc6530_fix) continue;
if (_chip == 1 && addr - 0x8c000114 <= 0x18) {
// ANA_LDO_SF_REG0
if (adi_read(0x8200148c) & 1 << 9)
val |= 0x200000;
else if (sys_data.chip_id.ver == 0xa0001)
val |= 0x280000;
}
MEM4(addr) = val;
} else break;
}
if (sys_data.gpio_init)
gpio_init((void*)pinmap);
} |
I have been trying to run doom on my Samsung B310E
I have no idea where to start
everything runs successfully but my samsung is just stuck at a black screen even though
I've done everything right (both Duke3D and Doom)
I'm on linux right now and only used the prebuilt binaries
if you want me to test anything I'd be happy to (running of RAM no sd card)
The text was updated successfully, but these errors were encountered: