Menu

Flashforth for dsPIC33CK64MC105

2025-08-05
2025-08-23
  • Chan Siu Fung John

    I am a computer hobbyist learning Flashforth using Microchip Curiosity Nano board with subject MCU.
    I am using MPLAB X IDE ver 5.50 and XC16 ver 1.61 to build the .hex file.

    However, I met the following messages:
    ../src/configs.c:597:9: error: unknown value for configuration settings 'RWDTPS' : 'PS2147483648
    ../src/configs.c:601:9: error: unknown value for configuration settings 'SWDTPS' : 'PS2147483648
    and 'make' stopped with Error 255 and Error 2.

    You can see exact detail as per the attached photo. The other photo show dashboard in the MPLAB X IDE environment.

    I have already gone through all the messages in this forum but cannot find anything relevant.
    I have also searched the internet using Google but cannot find any hints.

    Please kindly assist.

     
  • Chan Siu Fung John

    @oh2aun
    @ronny suy

    Based on your previous experience working on the same board, please kindly shed some light.

     
  • Mikael Nordman

    Mikael Nordman - 2025-08-06

    You can create valid configs in Mplabx. Generate the C source code and copy paste it into configs.c

     
  • Chan Siu Fung John

    @oh2aun thank you for your prompt reply.

    Apology that I am a newbie to both Forth and C programming.

    Will there be a tutorial telling me the way to create valid configs in Mplabx ?

     
  • Mikael Nordman

    Mikael Nordman - 2025-08-06

    I see your compiler is quite old. Please update to the latest mplabx and latest xc16. Then it should work.

     

    Last edit: Mikael Nordman 2025-08-06
  • Chan Siu Fung John

    @oh2aun Thank you for your suggestion. I have updated MPLAB X IDE to version 6.2 and XC16 version to 2.1. I have also learned how to obtain the configs.c using configuration bits generator.

    Below are the messages after made and loaded Flashforth 5.0 to my board:

    (1) make processes:

    make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
    make -f nbproject/Makefile-default.mk dist/default/production/FF_24-30-33.X.production.hex
    make[2]: Entering directory 'C:/Users/chans/Downloads/flashforth-code/pic24/FF_24-30-33.X'
    "C:\Program Files\Microchip\xc16\v2.10\bin\xc16-gcc.exe" ../src/configs.c -o build/default/production/_ext/1360937237/configs.o -c -mcpu=33CK64MC105 -MP -MMD -MF "build/default/production/_ext/1360937237/configs.o.d" -g -omf=elf -DXPRJ_default=default -I"../src" -msmall-code -msmall-data -O0 -msmart-io=1 -Wall -msfr-warn=off -mdfp="C:/Users/chans/.mchp_packs/Microchip/dsPIC33CK-MC_DFP/1.8.299/xc16"
    make[2]: Leaving directory 'C:/Users/chans/Downloads/flashforth-code/pic24/FF_24-30-33.X'
    make[2]: Entering directory 'C:/Users/chans/Downloads/flashforth-code/pic24/FF_24-30-33.X'
    "C:\Program Files\Microchip\xc16\v2.10\bin\xc16-gcc.exe" ../src/ff-pic24-30-33.s -o build/default/production/_ext/1360937237/ff-pic24-30-33.o -c -mcpu=33CK64MC105 -omf=elf -DXPRJ_default=default -I"../src" -Wa,-MD,"build/default/production/_ext/1360937237/ff-pic24-30-33.o.d",--defsym=__MPLAB_BUILD=1,-g,--no-relax,-a=build/default/production/_ext/1360937237/ff-pic24-30-33.lst -mdfp="C:/Users/chans/.mchp_packs/Microchip/dsPIC33CK-MC_DFP/1.8.299/xc16"
    make[2]: Leaving directory 'C:/Users/chans/Downloads/flashforth-code/pic24/FF_24-30-33.X'

    Info: Loading file: C:/Users/chans/.mchp_packs/Microchip/dsPIC33CK-MC_DFP/1.8.299/xc16/bin/../support/dsPIC33C/gld\p33CK64MC105.gld
    make[2]: Entering directory 'C:/Users/chans/Downloads/flashforth-code/pic24/FF_24-30-33.X'
    "C:\Program Files\Microchip\xc16\v2.10\bin\xc16-gcc.exe" -o dist/default/production/FF_24-30-33.X.production.elf build/default/production/_ext/1360937237/ff-pic24-30-33.o build/default/production/_ext/1360937237/configs.o -mcpu=33CK64MC105 -omf=elf -DXPRJ_default=default -I"../src" -Wl,--no-local-stack,,--defsym=__MPLAB_BUILD=1,,--script=p33CK64MC105.gld,--stack=16,--check-sections,--no-data-init,--pack-data,--no-handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,-Map="dist/default/production/FF_24-30-33.X.production.map",--report-mem,--cref,--memorysummary,dist/default/production/memoryfile.xml,-lm -mdfp="C:/Users/chans/.mchp_packs/Microchip/dsPIC33CK-MC_DFP/1.8.299/xc16"

    xc16-ld 2.10 (B)

    Default Code Model: Small
    Default Data Model: Large
    Default Scalar Model: Small

    "program" Memory [Origin = 0x200, Length = 0xad00]

    section address length (PC units) length (bytes) (dec)
    ------- ------- ----------------- --------------------
    .text 0x200 0x2 0x3 (3)
    .text 0x800 0x3800 0x5400 (21504)

                 Total "program" memory used (bytes):         0x5403  (21507) 32%
    

    "data" Memory [Origin = 0x1000, Length = 0x2000]

    section address alignment gaps total length (dec)
    ------- ------- -------------- -------------------
    .bss 0x1000 0 0xed4 (3796)

                 Total "data" memory used (bytes):          0xed4  (3796) 46%
    

    Dynamic Memory Usage

    region address maximum length (dec)
    ------ ------- ---------------------
    heap 0 0 (0)
    stack 0x1ed4 0x112c (4396)

                 Maximum dynamic memory (bytes):         0x112c  (4396)
    

    (2) load processes:

    Currently loaded versions:
    Application version...........1.30.35 (0x01.0x1e.0x23)
    Tool pack version .............1.16.876
    Entering firmware upgrade mode

    Currently loaded versions:
    Boot version..................0.0.0 (0x00.0x00.0x00)
    Updating firmware application...

    Currently loaded versions:
    Application version...........1.32.46 (0x01.0x20.0x2e)
    Tool pack version .............1.16.876
    Target voltage detected
    Target device dsPIC33CK64MC105 found.
    Device Revision Id = 0x3
    Device Id = 0x99120000
    UDID1 = 0e16bd
    UDID2 = 00bf20
    UDID3 = 170002
    UDID4 = 000000
    UDID5 = 0000eb

    Calculating memory ranges for operation...

    Erasing...

    The following memory area(s) will be programmed:
    program memory: start address = 0x0, end address = 0x2fff
    configuration memory

    Programming complete

    (3) written to device:

    August 21 2025--- 19:39:23
    API command: Begin communication session
    API command: Begin communication session
    API command: Start programming operation
    Set Programming Executive (6144 bytes at address 0x1000000)
    API command: read ID
    API command: End of operations
    API command: Start programming operation
    Set Programming Executive (6144 bytes at address 0x1000000)
    API command: Read 4096 bytes from address 0x1002000 of Test memory
    API command: Read 20 bytes from address 0x1002400 of UDID memory
    API command: Read 4096 bytes from address 0x015000 of Pgm memory
    API command: Read 4096 bytes from address 0x015000 of Pgm memory
    API command: Erase
    API command: Read 4096 bytes from address 0x015000 of Pgm memory
    API command: Write 24576 bytes to address 0x000000 of Pgm memory
    API command: Write 4096 bytes to address 0x015000 of Pgm memory
    API command: End of operations
    API command: Release from reset
    API command: End communication session

    Curiosity Board: dsPIC33CK64MC105 Curiosity Nano [SN: MC020023603FAS000628]

    However, I cannot get the OK prompt by connecting to the debugger USB type C port.

    I have another PIC24FJ64GU205 curiosity nano board which can be connected using not the debug port, but the 'target USD' port.

    The following screen can be shown:

    ok<#,ram>
    words
    p2+ anselc latc trisc portc anselb latb trisb portb ansela lata trisa porta sum[16] pad true false Fcy dump allot .s words ms ticks r0 s0 latest rhere state ind bl rdrop endit next for repeat while again until begin else then if until, again, begin, else, then, if, not, nc, z, un, in, inline ['] ;i ; :noname : ] [ does> postpone create [char] ( char ' abort" ?abort ?abort? abort prompt quit >dp dp> .st inlined immediate shb float? interpret in? 'source >in tiu tib ti# number? >number sign? digit? find immed? (f) c>n n>c @+ c@+ place wmove cmove fill blanks erase word parse \ /string source base hb hp task ssave rsave ulink bin hex decimal hi fsize d. ud. . u.r u. sign #> #s # digit <# hold up min max ?negate tuck nip ud/mod ud / / /mod u/mod u/ * u> u< d> > d< < d= = <> within +! ." ," s" (s") type >< >pr .id accept 1 0 umax umin spaces space cr 2swap 2dup 2drop 2! 2@ chars char+ cells cell+ aligned align cell c, , here dp ram flash xa> >xa pfl 2constant constant co: 2variable variable >body to is defer value user q+ qm+ d>q uq/mod uq mod /mod u/mod sm/rem um/mod m um s>d p++ p+ pc! p! pc@ p@ @p r>p !p>r !p d0< 0< d0= 0= d2/ 2/ d2 2* 2- 1- 2+ 1+ ?dnegate dnegate negate dinvert invert xor or and d- - d+ m+ + dabs abs 2r@ r@ r> >r rot over swap drop rp0 rp@ sp@ sp! (d) (c) (,) exit @ex execute dup txu rxu rxu? usb- usb+ rx1? rx1 tx1? tx1 u1rxq u1txq cq: cq0 cq>? cq> >cq? >cq 'key? 'key 'emit key? key emit scan skip n= rshift lshift mtst mclr mset x! x@ c@ @ c! ! u1- u1+ fl- fl+ iflush cf, as, cf@ cf! btss, btsc, btst, bset, bclr, as0 bra, retfie, return, rcall, operator ei di i] [i int! cwd pause pps- pps+ turnkey warm forget empty cpuload busy idle ? a> >a literal
    marker ok<#,ram>
    warm FlashForth 5 PIC24 16.04.2024

    The version of Flashforth used was also compiled by myself using older version of MPLAB X IDE before my trial with the dsPIC33 board.

    Plesae kindly advise the proper way to connect dsPIC33CK64MC105 board.

     
  • Mikael Nordman

    Mikael Nordman - 2025-08-22

    I am using linux and I connect /dev/ttyACM0 38400 baud and it works just fine. I am compiling with unmodified code and configuration.

    warm
     S FlashForth 5 PIC24 16.04.2024
    
     1 2 + .
     3  ok<#,ram> 
    
     
  • Chan Siu Fung John

    @oh2aun I had not changed the p33ck_config.inc but had used that attached configs.c shown by the configuration bit generator.

    I have also attached a photo showing both the dsPIC33CK64MC105 and PIC24FJ64GU205 curiosity nano board.

     
  • Mikael Nordman

    Mikael Nordman - 2025-08-23

    Your config is wrong. Use the original config.
    FNOSC = FRCPLL is the correct one to get the clock working right.

     
  • Chan Siu Fung John

    @oh2aun Hi Mikael, thank you for your suggestion.

    I have re-compile with the original source and config.

    FlashForth 5 is working as expected now. I am also using the only USB type C port (debug) to connect to my PC.

    ok<#,ram>
    warm S FlashForth 5 PIC24 16.04.2024

    words
    p2+ anseld latd trisd portd anselc latc trisc portc anselb latb trisb portb ansela lata trisa porta sum[16] fir pad true false Fcy dump allot .s words ms ticks r0 s0 latest rhere state ind bl rdrop endit next for repeat while again until begin else then if until, again, begin, else, then, if, not, nc, z, un, in, inline ['] ;i ; :noname : ] [ does> postpone create [char] ( char ' abort" ?abort ?abort? abort prompt quit >dp dp> .st inlined immediate shb float? interpret in? 'source >in tiu tib ti# number? >number sign? digit? find immed? (f) c>n n>c @+ c@+ place wmove cmove fill blanks erase word parse \ /string source base hb hp task ssave rsave ulink bin hex decimal hi fsize d. ud. . u.r u. sign #> #s # digit <# hold up min max ?negate tuck nip ud/mod ud / / /mod u/mod u/ * u> u< d> > d< < d= = <> within +! ." ," s" (s") type >< >pr .id accept 1 0 umax umin spaces space cr 2swap 2dup 2drop 2! 2@ chars char+ cells cell+ aligned align cell c, , here dp ram flash xa> >xa pfl 2constant constant co: 2variable variable >body to is defer value user q+ qm+ d>q uq/mod uq mod /mod u/mod sm/rem um/mod m um s>d p++ p+ pc! p! pc@ p@ @p r>p !p>r !p d0< 0< d0= 0= d2/ 2/ d2 2* 2- 1- 2+ 1+ ?dnegate dnegate negate dinvert invert xor or and d- - d+ m+ + dabs abs 2r@ r@ r> >r rot over swap drop rp0 rp@ sp@ sp! (d) (c) (,) exit @ex execute dup rx1? rx1 tx1? tx1 u1rxq u1txq cq: cq0 cq>? cq> >cq? >cq 'key? 'key 'emit key? key emit scan skip n= rshift lshift mtst mclr mset x! x@ c@ @ c! ! u1- u1+ fl- fl+ iflush cf, as, cf@ cf! btss, btsc, btst, bset, bclr, as0 bra, retfie, return, rcall, operator ei di i] [i int! cwd pause pps- pps+ turnkey warm forget empty cpuload busy idle ? a> >a literal
    marker ok<#,ram

    I will perform the same for my PIC24 board later.

    Thank you very much for your patience and guidance.

    By the way, are your Flash Forth 6 available only for PIC18 now and is it in the alpha or beta stage ?

     
  • Mikael Nordman

    Mikael Nordman - 2025-08-23

    FlashForth 6 is an experiment to see how to support vocabularies and other features. Vocabulary support requires EEPROM that PIC24 and dsPIC do not support. It is alpha phase but there is no schedule.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.