MIPS32 port

ChibiOS public support forum for topics related to the micro-controllers based on MIPS32 cores.
pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: MIPS32 port

Postby pito » Sat Jan 19, 2013 1:32 pm

A comparison - PIC32MX vs STM32F4 - test results per MHz

pic_stm_perMhz.jpg
pic_stm_perMhz.jpg (72.87 KiB) Viewed 2635 times

Dmytro
Posts: 98
Joined: Sun Oct 07, 2012 11:49 am

Re: MIPS32 port

Postby Dmytro » Sun Jan 20, 2013 2:46 am

I have a kind of good news: finally I defeated xc32. From now on it's possible to build and successfully run chibi built by this beast =).
Also I added generation of iHex for when built with GCC.
I've pushed my changes into the repository.
Now I'm going to start on some peripherals.
Also I would like to add possibility to run some code from RAM. It could be interesting for performance boost. Especially some hot paths like ISRs and scheduler.

best regards,
-- dmytro

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: MIPS32 port

Postby pito » Sun Jan 20, 2013 11:13 am

There is still an issue with the .hex generated. When uploaded via pic32prog (lin) or flashed w/ pickit2 (win) it gets flashed, but it does not work.
The only way to get it flashed here is import/export via mplab and then flashed with pickit2.
Also getting this warning:

Code: Select all

..
Linking build/ch.elf
/usr/local/pic32-tools/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/bin/ld:ld/mips_pic32mx795f512l.lds:148: warning: memory region `exception_mem' not declared
/usr/local/pic32-tools/bin/../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/bin/ld: Warning: exception_mem memory region not defined, using default range: 0x9fc01000 .. 0x9fc01fff
Creating build/ch.srec
Creating build/ch.hex
..

Dmytro
Posts: 98
Joined: Sun Oct 07, 2012 11:49 am

Re: MIPS32 port

Postby Dmytro » Sun Jan 20, 2013 2:05 pm

It is working with pickit3. I'll try to get why it does not work with pickit2 ...

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: MIPS32 port

Postby pito » Sun Jan 20, 2013 5:49 pm

The generated hex:

Code: Select all

:10D12000A0B4009DD0D0009DE0B3009D9CC2009DA6
:0CD13000D0B3009D0000000000000000D3
:10D14000000000A0000000A0000000000C0000A0F3
:10D150000C0000A0140000A0140000A000000000BB
:10D1600000000000240000A0240000A00000000037
:10D1700000000000681500A07C1500A0681500A044
:10D18000681500A0440000A0440000A000000000BA
:10D19000500000A0500000A0050000005C0000A0AE
:10D1A000600000A0000000009001000000000000EE
:10D1B000700000A0700000A004000000F81600A09D
:10D1C000FC1600A0F81600A0F81600A01085009D1F
:10D1D00000000000940000A0940000A000000000E7
:10D1E000681500A06C1500A0681500A0681500A0C7
:10D1F0001085009D000000005CCB009D00A6009DF6
:10D200004CCB009DD0A5009D000000000000000058
:020000041FC01B
:1000000002001A2400809A4000688040006080400E
:1000100001608040009D083CB4030825FFFF093CB7


and the hex imported/exported via mplab (works):

Code: Select all

:10D12000A0B4009DD0D0009DE0B3009D9CC2009DA6
:10D13000D0B3009D0000000000000000FFFFFFFFD3
:10D14000000000A0000000A0000000000C0000A0F3
:10D150000C0000A0140000A0140000A000000000BB
:10D1600000000000240000A0240000A00000000037
:10D1700000000000681500A07C1500A0681500A044
:10D18000681500A0440000A0440000A000000000BA
:10D19000500000A0500000A0050000005C0000A0AE
:10D1A000600000A0000000009001000000000000EE
:10D1B000700000A0700000A004000000F81600A09D
:10D1C000FC1600A0F81600A0F81600A01085009D1F
:10D1D00000000000940000A0940000A000000000E7
:10D1E000681500A06C1500A0681500A0681500A0C7
:10D1F0001085009D000000005CCB009D00A6009DF6
:10D200004CCB009DD0A5009D000000000000000058
:10D21000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E
:10D22000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E

It seems the mplab does correct some anomalies within the hex (ie. line 10D13, and from 10D21 up)..

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: MIPS32 port

Postby pito » Sun Jan 20, 2013 7:47 pm

On the left there is .hex exported from pickit2 tool (preprocessed with imp/exp via mplab, hex which works) and right is the original .hex exported from pickit2.
The difference is depicted below:
dif.jpg
dif.jpg (23.64 KiB) Viewed 2597 times


PS: Solved??
When I load the "original hex" (bad one) into pickit2 I see DEVCFG0 as FF0A.
When I change manually the DEVCFG0 to FF0B (as it should be in "the good one") the hex WORKS.
So the bit0 of the DEVCFG0 is doing the trick. BTW FF0A means "DEBUG enabled".
Last edited by pito on Sun Jan 20, 2013 9:04 pm, edited 3 times in total.

Dmytro
Posts: 98
Joined: Sun Oct 07, 2012 11:49 am

Re: MIPS32 port

Postby Dmytro » Sun Jan 20, 2013 8:06 pm

I wonder whether that's a pb of pic32prog or pickit2 in general.
Did you try to flash the target with mplabx and 'broken' hex?

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: MIPS32 port

Postby pito » Sun Jan 20, 2013 8:11 pm

I am using pic32MX795F512H (64pin), so maybe there is a difference against pic32MX795F512L (100pin)
in processing of that bit0.
I cannot flash from mplabx as it does not support pickit2 for that mcu.

PS1: I've built it with
USE_OPT += -D__32MX795F512H__
and the picki2's ch.hex still shows F00A (bad) instead of F00B. So it seems the DEBUG config bits shall be set in the source.
Last edited by pito on Sun Jan 20, 2013 8:31 pm, edited 1 time in total.

pito
Posts: 199
Joined: Sun Nov 06, 2011 3:54 pm

Re: MIPS32 port

Postby pito » Sun Jan 20, 2013 8:29 pm

Yes, this creates the ch.hex which now works with pickit2 (win):

Code: Select all

PIC32MX_DEVCFG0(
                DEVCFG0_ICESEL_CH2    // Use PGC2/PGD2
                | DEVCFG0_DEBUG_DISABLED // Disable DEBUG by Pito
    );


There is still an issue with it, however, as the pic32prog (via hid bootloader, lin) flashes "boot mem" as well (it shall not) and the code does not work..

Code: Select all

pito@ubuntu:~/chibios/ChibiOS-mips-pic32mx/demos/MIPS-PIC32MX795F512L-PIC32-MAXI-WEB/build$ sudo  /home/pito/pic32prog/pic32prog ch.hex
Programmer for Microchip PIC32 microcontrollers, Version 1.74
    Copyright: (C) 2011-2012 Serge Vakulenko
      Adapter: HID Bootloader
 Program area: 1d000000-1d07ffff
    Processor: Bootloader
 Flash memory: 512 kbytes
         Data: 54124 bytes
        Erase: done
Program flash: ###################################################### done
 Program boot: # done     
 Verify flash: ###################################################### done
  Verify boot:  done       
Rate: 7346 bytes per second
Last edited by pito on Sun Jan 20, 2013 8:59 pm, edited 2 times in total.

Dmytro
Posts: 98
Joined: Sun Oct 07, 2012 11:49 am

Re: MIPS32 port

Postby Dmytro » Sun Jan 20, 2013 8:46 pm

Thanks for the analysis. I believe that by default it won't be harmful to disable DEBUG. I pushed this change.


Return to “MIPS32 Support”

Who is online

Users browsing this forum: No registered users and 1 guest